agent-proxy
Domain-based selective proxy CLI. Route AI services, developer tools, and search engines through your overseas server — everything else stays direct.
60+ domains pre-configured. One command to set up. SSH-encrypted tunnel. Zero runtime dependencies.
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Your Machine │
│ │
│ Browser / Electron ──PAC──▶ 127.0.0.1:18080 (PAC server) │
│ │ │
│ CLI / SDK ──env vars──▶ 127.0.0.1:18443 (SSH tunnel) │
│ │ │
└────────────────────────────────────┼────────────────────────────┘
│ SSH (encrypted)
▼
┌────────────────────────────────────────────────────────────────┐
│ Your ECS (Singapore / Tokyo / etc.) ││ 127.0.0.1:18443 ──▶ Squid (loopback only) ──▶ Target Site │ │ │ │ • Deny-first ACL (no public data port) │ │ • Blocks localhost / RFC1918 / cloud metadata │ └────────────────────────────────────────────────────────────────┘
**Two routing paths, one proxy:**
| Path | Mechanism | Scope |
|------|-----------|-------|
| Browser / Desktop | System PAC → `127.0.0.1:18080` | Only whitelisted domains |
| CLI / SDK | `https_proxy` + `no_proxy` env vars | All HTTP(S) except `no_proxy` |
## Install
Auto-detect OS/arch, pick fastest mirror, verify SHA-256
curl -fsSL https://raw.githubusercontent.com/chiga0/agent-proxy/main/install.sh | bash
<details>
<summary>Other install methods</summary>
China mirror (faster for CN users)
curl -fsSL https://agent-proxy.oss-cn-hangzhou.aliyuncs.com/install.sh | bash
Specific version
curl -fsSL ... | bash -s -- --version v0.6.1
Go install
GONOSUMDB=github.com/chiga0/agent-proxy go install github.com/chiga0/agent-proxy/cmd/agent-proxy@latest
Build from source
git clone https://github.com/chiga0/agent-proxy.git cd agent-proxy && make build