If you write code in mainland China, you have probably seen it: Claude Code hangs at sign-in, Cursor’s chat panel spins and then says it cannot reach the server, or Copilot suggestions stop arriving halfway through a session. People often search for a VPN for Cursor or Claude Code at this point, but a working connection is only one of four separate layers. Fixing the wrong layer wastes an afternoon.
This guide walks through those layers in order. If you mainly use the browser apps, see our separate guides on using Claude in China, using ChatGPT in China and Codex showing “reconnecting” in China. This page focuses on coding tools that run in your terminal and editor.
Layer 1: account and supported-region eligibility
Check this first, because no network change can fix it.
- Claude Code signs in with a claude.ai subscription or an Anthropic Console account. Anthropic publishes a supported countries and regions list for both Claude.ai and the API, and mainland China and Hong Kong are not on it at the time of writing.
- Cursor says in its regions documentation that “some models in Cursor may be unavailable in certain regions based on the terms and policies set by the model providers.” So a message that a model is not available in your region is a provider policy decision, not a connection fault.
- GitHub Copilot uses your GitHub account and plan. Whether you are eligible depends on GitHub’s own terms and your plan, so check your account settings on github.com before you debug the network.
Please follow each provider’s terms of service and supported-region policy. A connection service changes the route your traffic takes. It does not change who a provider agrees to serve, and it should not be used to misstate where you are or who you are.
Layer 2: the network path (each tool reads proxy settings differently)
This is where most “it works in the browser but not in my editor” problems come from. Browsers, terminal tools and editor extensions each pick up proxy settings in their own way.
Terminal tools: Claude Code
Claude Code’s network configuration guide says it “respects standard proxy environment variables”: HTTPS_PROXY, HTTP_PROXY and NO_PROXY. Lowercase versions also work. Some practical points from that page:
- Set the variables before you launch
claude. Exported variables are read once at startup, so a session that is already running will not see changes. - The proxy URL needs a scheme, for example
http://127.0.0.1:7890. If the value cannot be parsed, Claude Code stops at launch with an error naming the variable. - The docs state plainly: “Claude Code does not support SOCKS proxies.” If your local client only offers a SOCKS port, use its HTTP port instead.
- Sign-in uses
claude.ai,claude.comandplatform.claude.com, and model traffic goes toapi.anthropic.com. If the browser sign-in page opens but the terminal never finishes logging in, the browser and the terminal are probably on different routes. - Run
/statusinside a session to see which proxy is active. You can also put the variables in theenvblock of~/.claude/settings.jsonso every session, including background agents, uses them.
Editors: VS Code, Copilot and Cursor
The VS Code network documentation explains that VS Code uses Chromium’s networking stack. It picks up system proxy settings automatically and also reads the http.proxy and http.proxyStrictSSL settings and the HTTP_PROXY / HTTPS_PROXY variables. The same page notes that extensions do not yet get the same proxy support as the editor itself, which is why the editor can update while an extension times out.
GitHub’s Copilot network settings page says Copilot checks HTTPS_PROXY, https_proxy, HTTP_PROXY and http_proxy in that order. It supports basic and Kerberos proxy authentication and reads extra certificates from NODE_EXTRA_CA_CERTS. The Copilot allowlist reference lists the hosts that must be reachable, including github.com, api.github.com, copilot-proxy.githubusercontent.com and *.githubcopilot.com. If sign-in works but suggestions never arrive, the problem is usually that last group.
Cursor is built on VS Code, and its troubleshooting page adds two Cursor-specific points:
- Cursor uses HTTP/2 for streaming, and some proxies block it. Go to Cursor Settings > Network and set HTTP Compatibility Mode to HTTP/1.1, then restart Cursor. The same panel has Run Diagnostics.
- Your firewall needs to allow
*.cursor.sh,*.cursor-cdn.com,*.cursorapi.comand*.cursorvm.com. After you switch or turn off a tunneling tool, fully restart Cursor so it picks up fresh DNS settings.
A “suspicious activity” message in Cursor is a security check, so treat it as an account question rather than something to work around.
On remote SSH sessions, Cursor’s docs say AI requests travel from your local machine. Claude Code runs wherever you start it, so a copy on a remote server needs its own HTTPS_PROXY.
Layer 3: TLS and certificate errors
Errors like self-signed certificate in certificate chain or unable to get local issuer certificate usually mean something on your network is inspecting HTTPS traffic.
- Claude Code trusts its bundled Mozilla certificates plus your operating system’s store by default. You can add a corporate root with
NODE_EXTRA_CA_CERTS(source). - Copilot reads the OS trust store and
NODE_EXTRA_CA_CERTS(source). - Turning off
http.proxyStrictSSLin VS Code hides the error but removes a safety check. If you do not know why a certificate is being replaced, find out before entering any credentials.
Layer 4: rate limits and real outages
Sometimes nothing is wrong on your side. Before you change settings, check the official status pages:
- Anthropic: status.claude.com, which tracks claude.ai, the Claude API and Claude Code separately
- Cursor: status.cursor.com
- GitHub, including Copilot: githubstatus.com
If the tool connects but refuses requests, read the error for a usage or quota message before blaming the route.
A quick diagnostic order
- Account and region eligibility under the provider’s policy.
- The status page.
- Browser, then terminal (
HTTPS_PROXY, HTTP not SOCKS), then editor (http.proxy; HTTP/1.1 mode in Cursor). - TLS errors: fix certificates rather than turning off verification.
Where SSRocket fits
SSRocket is a network acceleration service. It helps with one layer, the network path between your machine and overseas services, so terminal tools and editors have a consistent route. It cannot fix account, billing or regional-eligibility issues, and it does not change any provider’s terms. If you already have a subscription, the setup guide and the one-click subscription import guide explain how to import your subscription into a client. Clash-family clients then expose a local HTTP proxy port, shown in the client’s settings, which you can use in HTTPS_PROXY and http.proxy. For background, see global access, plans and the help center.
FAQ
Why does Claude Code work in my browser but not in the terminal?
The browser follows your system proxy, but Claude Code reads HTTPS_PROXY / HTTP_PROXY from the shell it was started in. Set the variable, use an HTTP (not SOCKS) port, and restart claude.
Can Claude Code use a SOCKS5 proxy?
According to Anthropic’s documentation, no. Claude Code does not support SOCKS proxies, so point it at an HTTP proxy port.
Cursor says a model “is not available in your region.” Is that a network problem?
Usually not. Cursor’s regions page says some models are unavailable in certain regions because of the model providers’ terms. Follow those terms rather than trying to hide your location.
Copilot signs in but suggestions never appear. What should I check?
Check that *.githubcopilot.com and copilot-proxy.githubusercontent.com are reachable through the same proxy the editor uses, and look at githubstatus.com for incidents.
Will a connection service make my AI tools faster?
It can give the tools a more consistent route to overseas servers. It cannot promise any particular speed, and it cannot fix outages, rate limits or account restrictions.
Sources
- Anthropic, Supported countries and regions: https://www.anthropic.com/supported-countries
- Claude Code, Enterprise network configuration: https://code.claude.com/docs/en/network-config
- Claude status page: https://status.claude.com
- Cursor, Regions: https://cursor.com/docs/models-and-pricing/regions.md
- Cursor, Common issues (network, HTTP/2, domains): https://cursor.com/docs/troubleshooting/common-issues
- Cursor status page: https://status.cursor.com
- GitHub Docs, Copilot network settings: https://docs.github.com/en/copilot/concepts/network-settings
- GitHub Docs, Copilot allowlist reference: https://docs.github.com/en/copilot/reference/allowlist-reference
- GitHub status page: https://www.githubstatus.com
- Visual Studio Code, Network connections: https://code.visualstudio.com/docs/setup/network