Skip to content

Upstream HTTP 502 - CC Switch (Claude Code / Codex)

Quick fix

Check your local network proxy (Clash/ZeroTier) config and make sure it does not interfere with direct requests.

Error output
[FWD-003] Provider s-gpt-20x-local 请求失败: 上游 HTTP 502
English translation

[FWD-003] Provider s-gpt-20x-local request failed: upstream HTTP 502

When CC Switch tries to forward a request directly to an upstream service on the LAN (Sub2API, for instance) and the upstream returns HTTP 502, the cause is usually not a defect in CC Switch itself but an intermediate network device or proxy program intercepting the traffic.

In the resolved cases, the problem came from the configuration of a local network management tool (Clash or ZeroTier, for example). Handling particular ports, IPs, or protocols (an SSE streaming response, say), those tools can hit compatibility problems that reset the connection or return a gateway error. Notably, relaying through an extra local Python forwarding proxy can make the request work again, which further points at network-layer interference on the original path rather than an application-layer logic error.

  1. Check and adjust the bypass rules or configuration of your local network proxy software (Clash, ZeroTier, V2Ray, and so on) so it does not wrongly intercept or modify traffic to the upstream service IP and port.

  2. Restart the network proxy software or reload its configuration, then retry the request in CC Switch.

ToolCodex / Claude Code
Version3.16.1 - 3.16.5
PlatformsWindows
Why does it succeed when forwarded through a local Python proxy?
Because the extra proxy may change HTTP headers (Connection, Accept-Encoding) or buffer the response, sidestepping the way the underlying network proxy software mishandles the original direct traffic.
Is this a CC Switch bug?
In the known cases, no — it is a compatibility problem between the local network environment (Clash/ZeroTier) and the upstream service. CC Switch acts only as a transparent forwarder in this scenario.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.