# avotcorg/proxy architecture

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

- Interactive diagram: https://gitdiagram.com/avotcorg/proxy
- Repository: https://github.com/avotcorg/proxy

## Overview

Check ProxyIP is a Cloudflare Worker web interface and JSON service for expanding and checking proxy targets. The main workflow is browser input → Worker task resolution → browser-side concurrent checks against an external service, with Worker-mediated fallback, then result display and export. Documented capabilities include domain A/AAAA/TXT resolution, filtering, batch imports, and recent-input history. A separate Bun helper checks a proxy list and writes active-list outputs. Worker internals are combined in one file; unsampled implementation links are based on README statements.

Main entry points: [`_worker.js`](https://github.com/avotcorg/proxy/blob/main/_worker.js) (Browser UI), [`helper/proxyip.ts`](https://github.com/avotcorg/proxy/blob/main/helper/proxyip.ts) (Proxy List Checker), [`rawProxyList.txt`](https://github.com/avotcorg/proxy/blob/main/rawProxyList.txt) (Raw Proxy List), [`ProxyList.txt`](https://github.com/avotcorg/proxy/blob/main/ProxyList.txt) (Generated Lists)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web Interface"]
  node_browser["Browser UI<br/>[_worker.js]"]
  node_input["Target Input<br/>[_worker.js]"]
  node_history[("Recent Inputs<br/>[_worker.js]")]
  node_results["Results &amp; Export<br/>[_worker.js]"]
end

subgraph group_worker["Worker Service"]
  node_worker_api["Worker API<br/>[_worker.js]"]
  node_target_parser["Target Parser<br/>[_worker.js]"]
  node_domain_resolver["Domain Resolver<br/>[_worker.js]"]
  node_task_list["Expanded Tasks<br/>[_worker.js]"]
end

subgraph group_checking["Probe Workflow"]
  node_scheduler["Probe Scheduler<br/>[_worker.js]"]
  node_client_probe["Browser Probe<br/>[_worker.js]"]
  node_worker_probe["Worker Probe<br/>[_worker.js]"]
end

subgraph group_helper["List Checker"]
  node_proxy_helper["Proxy List Checker<br/>[proxyip.ts]"]
  node_raw_list["Raw Proxy List<br/>[rawProxyList.txt]"]
  node_active_lists["Generated Lists<br/>[ProxyList.txt]"]
  node_kv_output["Country Proxy Map<br/>[kvProxyList.json]"]
end

node_user(("User"))
node_dns["Cloudflare DoH"]
node_external_api["External Check API"]
node_ip_resolver["IP Resolver"]

node_user -->|"uses"| node_browser
node_browser -->|"accepts targets"| node_input
node_browser -->|"stores recent"| node_history
node_browser -->|"requests tasks"| node_worker_api
node_worker_api -.->|"parses targets"| node_target_parser
node_worker_api -->|"expands domains"| node_domain_resolver
node_domain_resolver -->|"queries records"| node_dns
node_worker_api -->|"returns tasks"| node_task_list
node_browser -->|"schedules checks"| node_scheduler
node_scheduler -->|"runs probes"| node_client_probe
node_client_probe -->|"checks targets"| node_external_api
node_client_probe -->|"falls back"| node_worker_probe
node_worker_probe -->|"checks targets"| node_external_api
node_browser -.->|"renders results"| node_results
node_results -->|"shows and exports"| node_user
node_proxy_helper -->|"reads list"| node_raw_list
node_proxy_helper -->|"requests exit IP"| node_ip_resolver
node_proxy_helper -->|"writes checked list"| node_active_lists
node_proxy_helper -->|"writes country map"| node_kv_output

click node_browser "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_input "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_history "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_results "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_worker_api "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_target_parser "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_domain_resolver "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_task_list "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_scheduler "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_client_probe "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_worker_probe "https://github.com/avotcorg/proxy/blob/main/_worker.js"
click node_proxy_helper "https://github.com/avotcorg/proxy/blob/main/helper/proxyip.ts"
click node_raw_list "https://github.com/avotcorg/proxy/blob/main/rawProxyList.txt"
click node_active_lists "https://github.com/avotcorg/proxy/blob/main/ProxyList.txt"
click node_kv_output "https://github.com/avotcorg/proxy/blob/main/kvProxyList.json"

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_browser,node_input,node_history,node_results,node_user toneBlue
class node_worker_api,node_target_parser,node_domain_resolver,node_task_list toneAmber
class node_scheduler,node_client_probe,node_worker_probe,node_external_api toneMint
class node_proxy_helper,node_raw_list,node_active_lists,node_kv_output toneRose
class node_dns,node_ip_resolver toneIndigo
```

## Components

### Web Interface

- [Browser UI](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Target Input](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Recent Inputs](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Results & Export](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`

### Worker Service

- [Worker API](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Target Parser](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Domain Resolver](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Expanded Tasks](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`

### Probe Workflow

- [Probe Scheduler](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Browser Probe](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`
- [Worker Probe](https://github.com/avotcorg/proxy/blob/main/_worker.js): `_worker.js`

### List Checker

- [Proxy List Checker](https://github.com/avotcorg/proxy/blob/main/helper/proxyip.ts): `helper/proxyip.ts`
- [Raw Proxy List](https://github.com/avotcorg/proxy/blob/main/rawProxyList.txt): `rawProxyList.txt`
- [Generated Lists](https://github.com/avotcorg/proxy/blob/main/ProxyList.txt): `ProxyList.txt`
- [Country Proxy Map](https://github.com/avotcorg/proxy/blob/main/kvProxyList.json): `kvProxyList.json`

### Other components

- **User**
- **Cloudflare DoH**
- **External Check API**
- **IP Resolver**

## Connections

- User → Browser UI: uses (evidence: `README.md`)
- Browser UI → Target Input: accepts targets (evidence: `README.md`)
- Browser UI → Recent Inputs: stores recent (evidence: `README.md`)
- Browser UI → Worker API: requests tasks (evidence: `README.md`)
- Worker API → Target Parser: parses targets (evidence: `_worker.js`)
- Worker API → Domain Resolver: expands domains (evidence: `README.md`)
- Domain Resolver → Cloudflare DoH: queries records (evidence: `README.md`)
- Worker API → Expanded Tasks: returns tasks (evidence: `README.md`)
- Browser UI → Probe Scheduler: schedules checks (evidence: `README.md`)
- Probe Scheduler → Browser Probe: runs probes (evidence: `README.md`)
- Browser Probe → External Check API: checks targets (evidence: `README.md`)
- Browser Probe → Worker Probe: falls back (evidence: `README.md`)
- Worker Probe → External Check API: checks targets (evidence: `README.md`)
- Browser UI → Results & Export: renders results (evidence: `_worker.js`)
- Results & Export → User: shows and exports (evidence: `README.md`)
- Proxy List Checker → Raw Proxy List: reads list (evidence: `helper/proxyip.ts`)
- Proxy List Checker → IP Resolver: requests exit IP (evidence: `helper/proxyip.ts`)
- Proxy List Checker → Generated Lists: writes checked list (evidence: `helper/proxyip.ts`)
- Proxy List Checker → Country Proxy Map: writes country map (evidence: `helper/proxyip.ts`)
