# jhao104/proxy_pool architecture

> Architecture diagram of the GitHub repository jhao104/proxy_pool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jhao104/proxy_pool
- Repository: https://github.com/jhao104/proxy_pool

## Overview

ProxyPool collects free proxies on a schedule, validates and deduplicates them, stores usable entries, and serves them through an HTTP API for crawler clients. The repository also documents separate schedule and server commands and extensible, dynamically discovered proxy sources. The graph shows the evidenced collection, validation, persistence, and API paths; database backends and validator details are represented at their implementation boundaries. The source excerpts do not show every scheduler or launcher call, so some wiring is supported by the SOURCE INDEX or README rather than inspected implementation.

Main entry points: [`helper/fetch.py`](https://github.com/jhao104/proxy_pool/blob/master/helper/fetch.py) (Fetcher orchestrator), [`helper/check.py`](https://github.com/jhao104/proxy_pool/blob/master/helper/check.py) (Proxy checker), [`fetcher/sources`](https://github.com/jhao104/proxy_pool/tree/master/fetcher/sources) (Source plugins), [`db/dbClient.py`](https://github.com/jhao104/proxy_pool/blob/master/db/dbClient.py) (Database client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Proxy collection"]
  node_fetcher["Fetcher orchestrator<br/>[fetch.py]"]
  node_sources["Source plugins"]
  node_basefetcher["Fetcher base<br/>[baseFetcher.py]"]
  node_webrequest["Web requests<br/>[webRequest.py]"]
end

subgraph group_quality["Validation"]
  node_precheck["Pre-validation<br/>[validator.py]"]
  node_checker["Proxy checker<br/>[check.py]"]
end

subgraph group_pool["Proxy pool"]
  node_proxy["Proxy model<br/>[proxy.py]"]
  node_proxyhandler["Pool operations<br/>[proxyHandler.py]"]
  node_dbclient["Database client<br/>[dbClient.py]"]
  node_redis[("Redis backend<br/>[redisClient.py]")]
  node_ssdb[("SSDB backend<br/>[ssdbClient.py]")]
end

subgraph group_access["Runtime and access"]
  node_schedule["Schedule command<br/>[proxyPool.py]"]
  node_server["Server command<br/>[proxyPool.py]"]
  node_launcher["Process launcher<br/>[launcher.py]"]
  node_scheduler["Job scheduler<br/>[scheduler.py]"]
  node_api["Proxy API<br/>[proxyApi.py]"]
  node_config["Configuration<br/>[configHandler.py]"]
end

node_crawler(("Crawler client"))
node_operator(("Operator"))
node_sourceweb(("Proxy source sites"))
node_validationweb(("Validation endpoints"))

node_operator -->|"starts schedule"| node_schedule
node_operator -->|"starts server"| node_server
node_schedule -->|"dispatches"| node_launcher
node_server -->|"dispatches"| node_launcher
node_launcher -->|"starts scheduler"| node_scheduler
node_launcher -->|"starts API"| node_api
node_scheduler -->|"runs collection"| node_fetcher
node_scheduler -->|"runs checks"| node_checker
node_fetcher -->|"discovers and invokes"| node_sources
node_sources -->|"implements"| node_basefetcher
node_sources -->|"requests pages"| node_webrequest
node_sourceweb -.->|"provides proxy listings"| node_sources
node_fetcher -->|"filters candidates"| node_precheck
node_fetcher -->|"creates proxy records"| node_proxy
node_checker -->|"updates status"| node_proxy
node_checker -.->|"tests proxies"| node_validationweb
node_checker -->|"stores or deletes"| node_proxyhandler
node_api -->|"serves pool operations"| node_proxyhandler
node_proxyhandler -->|"delegates CRUD"| node_dbclient
node_dbclient -->|"dispatches Redis"| node_redis
node_dbclient -->|"dispatches SSDB"| node_ssdb
node_api -->|"returns proxy data"| node_crawler
node_config -->|"configures connection"| node_dbclient
node_config -->|"configures exclusions"| node_fetcher

click node_schedule "https://github.com/jhao104/proxy_pool/blob/master/proxyPool.py"
click node_server "https://github.com/jhao104/proxy_pool/blob/master/proxyPool.py"
click node_launcher "https://github.com/jhao104/proxy_pool/blob/master/helper/launcher.py"
click node_scheduler "https://github.com/jhao104/proxy_pool/blob/master/helper/scheduler.py"
click node_fetcher "https://github.com/jhao104/proxy_pool/blob/master/helper/fetch.py"
click node_sources "https://github.com/jhao104/proxy_pool/tree/master/fetcher/sources"
click node_basefetcher "https://github.com/jhao104/proxy_pool/blob/master/fetcher/baseFetcher.py"
click node_webrequest "https://github.com/jhao104/proxy_pool/blob/master/util/webRequest.py"
click node_proxy "https://github.com/jhao104/proxy_pool/blob/master/helper/proxy.py"
click node_precheck "https://github.com/jhao104/proxy_pool/blob/master/helper/validator.py"
click node_checker "https://github.com/jhao104/proxy_pool/blob/master/helper/check.py"
click node_proxyhandler "https://github.com/jhao104/proxy_pool/blob/master/handler/proxyHandler.py"
click node_dbclient "https://github.com/jhao104/proxy_pool/blob/master/db/dbClient.py"
click node_redis "https://github.com/jhao104/proxy_pool/blob/master/db/redisClient.py"
click node_ssdb "https://github.com/jhao104/proxy_pool/blob/master/db/ssdbClient.py"
click node_api "https://github.com/jhao104/proxy_pool/blob/master/api/proxyApi.py"
click node_config "https://github.com/jhao104/proxy_pool/blob/master/handler/configHandler.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fetcher,node_sources,node_basefetcher,node_webrequest,node_crawler toneBlue
class node_precheck,node_checker toneAmber
class node_proxy,node_proxyhandler,node_dbclient,node_redis,node_ssdb toneMint
class node_schedule,node_server,node_launcher,node_scheduler,node_api,node_config toneRose
class node_operator,node_sourceweb,node_validationweb toneIndigo
```

## Components

### Proxy collection

- [Fetcher orchestrator](https://github.com/jhao104/proxy_pool/blob/master/helper/fetch.py): `helper/fetch.py`
- [Source plugins](https://github.com/jhao104/proxy_pool/tree/master/fetcher/sources): `fetcher/sources`
- [Fetcher base](https://github.com/jhao104/proxy_pool/blob/master/fetcher/baseFetcher.py): `fetcher/baseFetcher.py`
- [Web requests](https://github.com/jhao104/proxy_pool/blob/master/util/webRequest.py): `util/webRequest.py`

### Validation

- [Pre-validation](https://github.com/jhao104/proxy_pool/blob/master/helper/validator.py): `helper/validator.py`
- [Proxy checker](https://github.com/jhao104/proxy_pool/blob/master/helper/check.py): `helper/check.py`

### Proxy pool

- [Proxy model](https://github.com/jhao104/proxy_pool/blob/master/helper/proxy.py): `helper/proxy.py`
- [Pool operations](https://github.com/jhao104/proxy_pool/blob/master/handler/proxyHandler.py): `handler/proxyHandler.py`
- [Database client](https://github.com/jhao104/proxy_pool/blob/master/db/dbClient.py): `db/dbClient.py`
- [Redis backend](https://github.com/jhao104/proxy_pool/blob/master/db/redisClient.py): `db/redisClient.py`
- [SSDB backend](https://github.com/jhao104/proxy_pool/blob/master/db/ssdbClient.py): `db/ssdbClient.py`

### Runtime and access

- [Schedule command](https://github.com/jhao104/proxy_pool/blob/master/proxyPool.py): `proxyPool.py`
- [Server command](https://github.com/jhao104/proxy_pool/blob/master/proxyPool.py): `proxyPool.py`
- [Process launcher](https://github.com/jhao104/proxy_pool/blob/master/helper/launcher.py): `helper/launcher.py`
- [Job scheduler](https://github.com/jhao104/proxy_pool/blob/master/helper/scheduler.py): `helper/scheduler.py`
- [Proxy API](https://github.com/jhao104/proxy_pool/blob/master/api/proxyApi.py): `api/proxyApi.py`
- [Configuration](https://github.com/jhao104/proxy_pool/blob/master/handler/configHandler.py): `handler/configHandler.py`

### Other components

- **Crawler client**
- **Operator**
- **Proxy source sites**
- **Validation endpoints**

## Connections

- Operator → Schedule command: starts schedule
- Operator → Server command: starts server
- Schedule command → Process launcher: dispatches (evidence: `proxyPool.py`)
- Server command → Process launcher: dispatches (evidence: `proxyPool.py`)
- Process launcher → Job scheduler: starts scheduler (evidence: `helper/launcher.py`)
- Process launcher → Proxy API: starts API (evidence: `helper/launcher.py`)
- Job scheduler → Fetcher orchestrator: runs collection (evidence: `helper/scheduler.py`)
- Job scheduler → Proxy checker: runs checks (evidence: `helper/scheduler.py`)
- Fetcher orchestrator → Source plugins: discovers and invokes (evidence: `helper/fetch.py`)
- Source plugins → Fetcher base: implements (evidence: `fetcher/sources/scdn.py`)
- Source plugins → Web requests: requests pages (evidence: `fetcher/sources/daili66.py`)
- Proxy source sites → Source plugins: provides proxy listings
- Fetcher orchestrator → Pre-validation: filters candidates (evidence: `helper/fetch.py`)
- Fetcher orchestrator → Proxy model: creates proxy records (evidence: `helper/fetch.py`)
- Proxy checker → Proxy model: updates status (evidence: `helper/check.py`)
- Proxy checker → Validation endpoints: tests proxies
- Proxy checker → Pool operations: stores or deletes (evidence: `helper/check.py`)
- Proxy API → Pool operations: serves pool operations (evidence: `api/proxyApi.py`)
- Pool operations → Database client: delegates CRUD (evidence: `handler/proxyHandler.py`)
- Database client → Redis backend: dispatches Redis (evidence: `db/dbClient.py`)
- Database client → SSDB backend: dispatches SSDB (evidence: `db/dbClient.py`)
- Proxy API → Crawler client: returns proxy data
- Configuration → Database client: configures connection (evidence: `handler/proxyHandler.py`)
- Configuration → Fetcher orchestrator: configures exclusions (evidence: `helper/fetch.py`)
