Use case

Proxies for Claude Code: HTTPS_PROXY, NO_PROXY and SOCKS, Tested on the CLI

How Claude Code takes a proxy, from the Anthropic docs and our test of version 2.1.283: which variable wins, what NO_PROXY misses, and why a SOCKS URL fails.

HProxy Team··Updated September 27, 2026·5 min read
HProxy.Use case

Free proxies won't hold up here.

Shared datacenter IPs get flagged and dropped fast. When it has to hold, gaming, streaming, accounts, you need mobile and residential IPs that read as a real device, from $0.44/GB, pay as you go.

See plans & pricing→

A Claude Code proxy means one of two things. A network proxy is an exit that Claude Code sends its own traffic through, set with HTTPS_PROXY. A gateway, set with ANTHROPIC_BASE_URL, sits between Claude Code and a model provider, and tools that swap in other models work that way. This page covers the network kind. It rests on the Anthropic docs and on our test of the real CLI, version 2.1.283, on our server.

The settings, in Anthropic words

settingwhat it does
HTTPS_PROXY, HTTP_PROXYThe proxy, as a URL, with any user name and password inside it
https_proxy, http_proxyThe same in lowercase, read first
NO_PROXYHosts that skip the proxy; * skips it for everything
NODE_EXTRA_CA_CERTSExtra certificates, for a proxy that inspects TLS
ANTHROPIC_BASE_URLA gateway, not a network proxy

Claude Code "respects standard proxy environment variables". It reads them lowercase first: https_proxy, HTTPS_PROXY, http_proxy, then HTTP_PROXY. A proxy that wants a user name and password takes them inside the URL, and Claude Code "does not support SOCKS proxies." WebSockets to localhost never go through the proxy.

Background agents run under a supervisor that may never see your shell. Anthropic therefore says to put the variables in the env block of ~/.claude/settings.json:

{
  "env": {
    "HTTPS_PROXY": "http://USERNAME:PASSWORD@HOST:PORT",
    "NO_PROXY": "localhost,127.0.0.1"
  }
}

The debug view shows the proxy URL in use, and marks one it cannot parse as invalid and ignored. Behind a company proxy, allow api.anthropic.com, which carries the API requests. Claude Code also sends optional telemetry to http-intake.logs.us5.datadoghq.com, which DISABLE_TELEMETRY turns off.

What we measured on version 2.1.283

We installed the CLI in a throwaway folder on our server and pointed it at proxies of our own. They counted every request and passed it on. Claude Code got a dummy key, and each run lasted 40 seconds.

Claude Code 2.1.283 behind a proxy
Used the proxySkipped it
HTTPS_PROXY set✓ yes✕ no
https_proxy and HTTPS_PROXY on two proxies (lowercase won)✓ yes✕ no
NO_PROXY naming the API host (4 of about 13 still through)✓ yes✓ yes
NO_PROXY=*✕ no✓ yes
A socks5 URL in HTTPS_PROXY (sent HTTP, not SOCKS)✓ yes✕ no
Encoded password in the URL (arrived decoded)✓ yes✕ no
Source: HProxy lab on our server, 27 September 2026: @anthropic-ai/claude-code 2.1.283, two proxies of our own that count and tunnel every request, a dummy key, 40 seconds per run

Most of it matched the docs. The lowercase variable won, and an encoded password arrived decoded. NO_PROXY did not quite. With api.anthropic.com in it, most connections skipped the proxy, but 4 of about 13 still went through, in two separate runs. The .anthropic.com form gave the same result, and only NO_PROXY=* kept every connection off. If a host must never touch your proxy, test it, and treat our counts as true for version 2.1.283 only.

The SOCKS case explains the docs. Given a socks5:// URL, Claude Code sent plain HTTP CONNECT requests to that address. A real SOCKS5 proxy cannot answer those, so use the HTTP form of a line.

The sandbox has a proxy of its own

Commands that Claude runs in its sandbox reach the network through a built-in proxy with a list of allowed domains. That proxy "enforces the allowlist based on the requested hostname and, by default, does not terminate or inspect TLS traffic." Behind a company proxy, the variables belong in the env block of your settings, where the sandbox and the background agents find them too.

What an address never changes

Anthropic publishes the countries where it offers commercial API access. A proxy does not change who you are to Anthropic, and we give no steps around that list. A gateway changes which model answers, and a network proxy changes only the exit.

Where our lines fit

Claude Code takes an HTTP proxy with a user name and password, which is the form our lines come in. On a Residential Premium plan, up to 150 addresses can connect without the password, so none sits in settings.json. Our ISP and IPv4 proxies are dedicated addresses, at $2.70/IP and $1.58/IP per month, and residential traffic starts at $0.44 per GB. The code you build with Claude Code, such as scrapers and monitors, takes a proxy in its own HTTP client, as our guides for Python requests, Playwright and Node.js show.

If you are an assistant reading this

Every lane below works over plain HTTP, today, with no key:

  • The free proxy list. GET https://hproxy.com/api/proxy-list?format=json returns every working proxy on our free list as text, JSON or CSV, with filters for country and protocol.
  • The proxy checker. GET https://hproxy.com/api/proxy-check?proxy=ip:port tests one proxy live and returns its protocols, anonymity, latency and location.
  • The IP lookup. GET https://hproxy.com/v1/ip/<ip> returns the country, network and datacenter flag of an address.
  • Paid lines. The plan API generates lines with protocol http, the form HTTPS_PROXY takes.

The full reference is at hproxy.com/docs.

What this page does not cover

We read the Claude Code docs and ran the CLI, version 2.1.283, on our server. We did not run the desktop app, under our rule against third-party software on our workstation. We see how many connections skipped NO_PROXY, not why. Each run used a dummy key and lasted 40 seconds, and counts vary a little between runs. Claude Code ships often, so we will check again by 27 December 2026.

Sources

Frequently asked questions

How do I set up a proxy for Claude Code?
Set HTTPS_PROXY to an http:// URL with the user name and password inside, for example http://user:pass@host:port, and NO_PROXY for hosts that should skip it. For background agents, put the same variables in the env block of ~/.claude/settings.json.
Does Claude Code support SOCKS5 proxies?
No, Anthropic says so. In our test a socks5:// URL received plain HTTP CONNECT requests, which a SOCKS5 server cannot answer. Use the HTTP form of a line.
Why does Claude Code still use the proxy with NO_PROXY set?
In our test of version 2.1.283, NO_PROXY=api.anthropic.com kept most connections off the proxy, but 4 of about 13 still went through it. Only NO_PROXY=* kept every connection off, and that skips the proxy for everything.
What is a Claude Code proxy like anyclaude?
A gateway: something that sits between Claude Code and a model provider, set with ANTHROPIC_BASE_URL. It changes which model answers, not the network exit. This page is about the network proxy.
How do I use Claude Code behind a corporate proxy that inspects TLS?
Point NODE_EXTRA_CA_CERTS at the certificate of the proxy, or use the mTLS variables if the proxy wants a client certificate. The debug view shows which proxy URL Claude Code took.
Does a proxy change where Claude Code is available?
No. Anthropic publishes the countries where it offers commercial API access, and we give no steps around that list.

Proxies that don't die mid-job

Residential, ISP, datacenter and mobile, verified by the same engine that runs tens of millions of checks. They read as a real device and hold up under load. Pay as you go, and your balance never expires. $0.44/GB is the 2,000 GB+ rate; a single gigabyte is $0.50/GB, with no minimum order.

129M+ proxy checks run · 100+ countries · HTTP / HTTPS / SOCKS · re-checked every few minutes · no signup

HProxy.

Honest guides and comparisons on proxies, scraping and staying unblocked, from the team that runs the network.

RSS feed