Skip to content

CC Switch Proxy Fails or Requests Are Blocked by the System Proxy

Quick fix

Set CC Switch's global outbound proxy to your proxy application's address, or bypass local requests in the system proxy, then restart CC Switch.

Error output
开启ccswitch代理后,在vscode中使用cc插件,会出现Cannot read properties of null (reading 'output_tokens')导致对话中断
English translation

After enabling the ccswitch proxy, using the cc plugin in vscode causes Cannot read properties of null (reading 'output_tokens'), interrupting the conversation.

The local proxy in CC Switch can conflict with system proxy applications such as Surge, Clash, Mihomo, and V2Ray. If both are running, requests may be intercepted, routed incorrectly, or fail to connect. After the system proxy application is closed or its settings are cleared, CC Switch may continue using stale system proxy settings, causing requests to fail. Some users also reported that proxy ports were not saved correctly or that proxy settings did not take effect.

  1. If you use a system proxy application such as Surge or Clash, open 设置 -> 路由 -> 全局出站代理 in CC Switch and enter the proxy address of your system proxy application, such as http://127.0.0.1:7890, so CC Switch requests are forwarded through it.

    在 CC Switch 设置界面中配置
    设置 -> 路由 -> 全局出站代理: http://127.0.0.1:7890
  2. Alternatively, add a routing rule in the system proxy application, such as Surge, and place the CC Switch local proxy address, usually 127.0.0.1:8045 or a similar address, on the direct-connection list to prevent interception of local requests.

  3. If CC Switch cannot connect after you close the system proxy application, restart CC Switch so it can detect the network environment again.

  4. Check whether the port numbers for the global outbound proxy and the individually configured proxy were saved correctly. If a port is missing or replaced with 7890, configure it again manually and save the settings.

ToolClaude Code
Version3.12.2 - 3.16.4
PlatformsWindowsmacOS
Why does my MCP service also report a connection failure after I enable the CC Switch proxy?
The system proxy application is intercepting local proxy requests from CC Switch, preventing MCP services that depend on the proxy from communicating normally. Configure routing rules in the system proxy application or configure the global outbound proxy in CC Switch.
Why can CC Switch still not connect after I close the system proxy application?
CC Switch may have cached the previous system proxy settings. Restart CC Switch so it can detect the current network environment again.
Why is my proxy port changed automatically after I save it?
This is a bug in v3.12.2. The global outbound proxy port is removed after saving, and the individually configured proxy port is replaced with 7890. Upgrade to the latest version.
Can CC Switch automatically detect and use the system proxy?
Automatic system proxy detection is not currently supported. Manually configure the proxy address under 设置 -> 路由 -> 全局出站代理, or leave the option empty so CC Switch connects directly.

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.