Skip to content

v0.12.207 — Honor HTTPS_PROXY/HTTP_PROXY/ALL_PROXY for upstream

Choose a tag to compare

@VickyXAI VickyXAI released this 23 Jun 02:06
· 14 commits to main since this release

Honor standard proxy environment variables for upstream traffic.

  • HTTPS_PROXY / HTTP_PROXY / ALL_PROXY fallback (src/upstream-proxy.ts). Node's fetch (undici) ignores the standard proxy env vars, so users whose system traffic is meant to flow through a local proxy (mihomo/clash without TUN mode, corporate proxies) had ClawRouter connecting directly while their curl tests went through the proxy — on throttled routes (e.g. RU → Google-hosted gateway) this surfaced as instant 500s on large request bodies, Premature close, and per-model timeouts, while small requests slipped through. When BLOCKRUN_UPSTREAM_PROXY is unset, ClawRouter now applies the standard env vars via undici's EnvHttpProxyAgent. NO_PROXY is honored, and loopback hosts (localhost, 127.0.0.1, ::1) are always excluded so local health checks and sibling proxies stay direct. BLOCKRUN_UPSTREAM_PROXY still wins when set; SOCKS URLs in the standard env vars are not auto-applied (a warning points to BLOCKRUN_UPSTREAM_PROXY=socks5://…). (Test: test/upstream-proxy.test.ts, 9 cases, dependency-injected — no process-global mutation in tests.)

npm: @blockrun/clawrouter@0.12.207