← Back to Knowledge Base

Claude Code Not Connecting While Your Browser Works? Set Up a Terminal Proxy

Sun Oct 25 2026

Claude opens in your browser, but claude in a terminal times out or cannot complete login. Before switching nodes, check whether the terminal actually uses your proxy. A browser extension, system proxy switch, and shell environment are different settings.

This guide covers the standalone Claude Code CLI. It does not configure Claude Desktop. You need an eligible account and an officially supported location; working networking does not change either requirement.

These temporary shell settings apply to a foreground CLI launched from this terminal. For --bg or background agents, follow the official background-agent configuration: their long-running supervisor does not reliably inherit later shell changes.

1. Connect the client before configuring Claude Code

The subscription configures nodes in your client. The actual request route is:

Claude Code → local HTTP/mixed listener in the client → selected JMS node → Anthropic service.

Import your current subscription into a client that supports its actual node protocol. JMS has changed protocols during 2026; do not assume an older Shadowsocks-only client still works. Follow the VLESS/Reality troubleshooting guide or Clash Verge subscription guide first.

In the client, find its local HTTP or mixed listening port, and keep the client running. This is not the remote server port, subscription URL, UUID, or Reality public key. The HTTP listener should bind to your own machine; do not enable LAN sharing just for this tutorial.

Claude Code supports HTTP/HTTPS proxy settings, but does not directly support SOCKS proxies, according to its official network documentation. If your client only exposes SOCKS, enable its HTTP/mixed listener or use another compatible client.

2. Set the proxy in the terminal that launches Claude

Use a separate terminal for this first test. Check locally whether https_proxy, HTTPS_PROXY, http_proxy, HTTP_PROXY, all_proxy, ALL_PROXY, no_proxy, or NO_PROXY already exist. Avoid posting their values: proxy URLs can contain passwords.

Claude Code chooses the first configured proxy in this order: https_proxy, HTTPS_PROXY, http_proxy, HTTP_PROXY. A stale lowercase value can override a new uppercase one. Other tools handle these variables differently; do not assume ALL_PROXY makes Claude use SOCKS. If settings already exist, preserve them privately and resolve conflicts before overwriting them.

macOS or Linux: Bash/Zsh

7890 is an example only. Replace it with the HTTP/mixed port shown in your client before running:

JMS_PROXY_PORT=7890
export HTTPS_PROXY="http://127.0.0.1:${JMS_PROXY_PORT}"
export HTTP_PROXY="$HTTPS_PROXY"
export NO_PROXY="localhost,127.0.0.1,::1"
claude

Windows: PowerShell

Again, replace 7890 with your client’s actual HTTP/mixed port. Paste this into PowerShell, not Command Prompt:

$JmsProxyPort = 7890
$env:HTTPS_PROXY = "http://127.0.0.1:$JmsProxyPort"
$env:HTTP_PROXY = $env:HTTPS_PROXY
$env:NO_PROXY = "localhost,127.0.0.1,::1"
claude

The http:// prefix describes the connection to the local proxy. It does not turn the destination’s HTTPS connection into unencrypted HTTP. NO_PROXY keeps local requests direct, which can help browser login callbacks reach the CLI.

These variables apply to this terminal and processes started from it. An already running Claude Code session will not pick up later shell changes: exit it, set the variables, and start claude again from this same terminal. Do not add persistent shell-profile settings until the temporary test works.

For WSL, containers, or SSH sessions, 127.0.0.1 means the environment running the command, which may not be the Windows or host machine running your client. Confirm reachability rather than exposing the proxy publicly.

3. Test the route without sharing credentials

Run the appropriate test in that configured terminal, after leaving Claude Code. It uses the local proxy explicitly, requests only the public API hostname, and sends no API key:

macOS/Linux:

curl --proxy "$HTTPS_PROXY" --noproxy "localhost,127.0.0.1,::1" --connect-timeout 10 --max-time 20 --output /dev/null --silent --show-error --write-out 'HTTP %{http_code}\n' https://api.anthropic.com/

Windows PowerShell uses curl.exe to avoid the older PowerShell curl alias:

curl.exe --proxy $env:HTTPS_PROXY --noproxy "localhost,127.0.0.1,::1" --connect-timeout 10 --max-time 20 --output NUL --silent --show-error --write-out "HTTP %{http_code}\n" https://api.anthropic.com/

The limits stop connection attempts after 10 seconds and the whole request after 20 seconds. HTTP 401, 403, or 404 can still mean an HTTP responder was reached; the API root is not a logged-in model request. Check the actual error before concluding that access works. A non-2xx result does not by itself prove the proxy failed, nor does any HTTP response prove your account can use Claude Code.

HTTP 000 with a connection error or timeout means no normal HTTP response arrived. A certificate error needs separate diagnosis. Keep TLS verification enabled: do not add -k or disable certificate checks to make a test pass. Never paste subscription URLs, login codes, tokens, or private diagnostic logs into public support posts.

4. Match the symptom to the next check

SymptomNext check
Local connection refusedClient running, correct HTTP/mixed port, correct host
Timeout or connection resetClient logs, selected node, DNS, firewall, and route
Browser login succeeds but CLI does not finishCallback reachability, NO_PROXY, CLI restart; follow the official login guidance
HTTP 401 or 403 in an authenticated requestLogin method, credentials, organization policy, and supported location; do not assume a speed problem
HTTP 429 or a usage-limit messageAccount quota or rate limits; changing nodes does not add usage allowance
Multiple devices fail at onceCheck Anthropic status before changing configuration

Check your version with claude --version, run claude doctor, and update using the method for your installation in the official setup guide. A version bug, expired login, or service incident can resemble a network failure.

5. Remove the temporary settings

If these variables did not exist before this test, clear just the values added above:

Bash/Zsh:

unset HTTPS_PROXY HTTP_PROXY NO_PROXY JMS_PROXY_PORT

PowerShell:

Remove-Item Env:HTTPS_PROXY, Env:HTTP_PROXY, Env:NO_PROXY -ErrorAction SilentlyContinue
Remove-Variable JmsProxyPort -ErrorAction SilentlyContinue

This deletes the current values; it does not restore previous values that you overwrote. Restore those privately if needed. Exit and restart Claude Code after changing the environment. Persistent system or profile settings require separate review.

Choosing a connection service

JMS can supply nodes for a compatible local client; the client and terminal settings connect those nodes to the CLI. It does not provide an Anthropic subscription, guarantee account approval or prevent suspensions. A local proxy also does not change the outbound route of a cloud-hosted MCP connector.

Check available plans and the client download guide against your devices and current protocols. If this setup fits your needs, view Just My Socks.

Affiliate disclosure: we may earn a commission if you purchase through that link.