Skip to content

Every common proxy error, and how to fix it

By the ProxyOnly team · 16 Nov 2026 · 7 min read

The exact messages curl, Python, Node.js and Chrome print when a proxy fails, grouped by cause, with what each one means and what to change.

A proxy error message tells you more than it seems to, once you know which machine produced it. The trouble is that every tool words the same failure differently. Chrome says ERR_TUNNEL_CONNECTION_FAILED where Python says Tunnel connection failed: 403 Forbidden and Node.js only says fetch failed.

So we built test proxies that fail on purpose, one failure each, and pointed four clients at them on 16 November 2026: curl 8.7.1, Python requests 2.34.2, Node.js 24.12 with its built-in fetch, and Chrome 157 driven by Playwright. Find your message below, and you have the cause and the fix.

First, who produced the error?

A proxied request can fail in four places: on your own machine before it reaches the proxy, at the proxy when it checks your login, at the proxy when it tries to reach the site, and at the site itself. Our proxy errors overview explains the layers. This page sorts the messages by those causes.

One pattern matters for HTTPS sites. The client first asks the proxy to open a tunnel with CONNECT. If the proxy refuses, the client reports a failed tunnel and never sees the site. If the tunnel opens and the site then refuses, you get the site's own status code, such as a 403 or 429 page.

The proxy wants a login: 407

The proxy received the request and rejected the username or password, or got none.

  • curl, HTTPS site: curl: (56) CONNECT tunnel failed, response 407
  • curl, plain HTTP site: no error, the response simply has status 407.
  • Python requests, HTTPS site: ProxyError(... OSError('Tunnel connection failed: 407 Proxy Authentication Required'))
  • Python requests, plain HTTP site: no exception, response.status_code is 407.
  • Node.js fetch: TypeError: fetch failed, with Proxy response (407) !== 200 when HTTP Tunneling two levels down the error's causes.
  • Chrome with no credentials: net::ERR_INVALID_AUTH_CREDENTIALS
  • Chrome driven by Playwright with a wrong password: net::ERR_HTTP_RESPONSE_CODE_FAILURE

To fix it, check the username and password character by character, and percent-encode special characters in a proxy URL. Our guide to using a proxy on any device has a section on passwords with @ or / in them. The 407 page covers the rest.

The proxy refused the request: 403 from the proxy

The proxy accepted your login, or needed none, and still refused. Proxies do this for destinations or ports they do not allow, and the reason is the proxy's policy rather than the website.

  • curl, HTTPS site: curl: (56) CONNECT tunnel failed, response 403
  • Python requests: ProxyError(... OSError('Tunnel connection failed: 403 Forbidden'))
  • Node.js fetch: Proxy response (403) !== 200 when HTTP Tunneling, under fetch failed
  • Chrome, HTTPS site: net::ERR_TUNNEL_CONNECTION_FAILED

A 403 that arrives after the tunnel opened comes from the website, not the proxy, and has different fixes. 403 Forbidden when using a proxy and our 403 guide tell the two apart.

The proxy could not reach the site: 502

The proxy accepted you and failed to connect onwards. We triggered it by asking a working proxy for a port where nothing listens.

  • curl, HTTPS site: curl: (56) CONNECT tunnel failed, response 502
  • curl and Python requests, plain HTTP site: a normal response with status 502.
  • Python requests, HTTPS site: ProxyError(... OSError('Tunnel connection failed: 502 Bad Gateway'))
  • Node.js fetch: Proxy response (502) !== 200 when HTTP Tunneling
  • Chrome, HTTPS site: net::ERR_TUNNEL_CONNECTION_FAILED

Retry once or twice, then check that the site is up from another network. 502 Bad Gateway through a proxy and 502 explained cover the cases where the site itself is the problem.

Nothing is listening: connection refused

Your machine reached the proxy's address and was told that no program listens on that port. The proxy is down, or the port is wrong.

  • curl: curl: (7) Failed to connect to 127.0.0.1 port 8199 after 0 ms: Couldn't connect to server
  • Python requests: ProxyError('Unable to connect to proxy', NewConnectionError(... [Errno 61] Connection refused))
  • Node.js fetch: connect ECONNREFUSED 127.0.0.1:8199
  • Chrome: net::ERR_PROXY_CONNECTION_FAILED

Check the port against your order page. Each of our proxies has its own port, and what is port 8080 explains how to test one. The ERR_PROXY_CONNECTION_FAILED page has the browser side.

The proxy's name does not resolve

The host name of the proxy did not turn into an address, usually because of a typo.

  • curl: curl: (5) Could not resolve proxy: no-such-proxy.invalid
  • Python requests: NameResolutionError(... Failed to resolve 'no-such-proxy.invalid' ...)
  • Node.js fetch: getaddrinfo ENOTFOUND no-such-proxy.invalid
  • Chrome: net::ERR_PROXY_CONNECTION_FAILED, the same message as a refused connection.

Copy the host from your order page instead of typing it. For our proxies it is usually an IP address.

Nothing answers: timeouts

Something accepted the connection and never replied, or nothing answered at all. We used a test proxy that accepts connections and stays silent.

  • curl, plain HTTP site: curl: (28) Operation timed out after 8006 milliseconds with 0 bytes received
  • curl, HTTPS site: curl: (28) Connection timed out after 8004 milliseconds
  • Python requests: ReadTimeout: ... Read timed out. (read timeout=8)
  • Node.js fetch with a timeout signal: TimeoutError: The operation was aborted due to timeout
  • Chrome through Playwright: Timeout 9000ms exceeded.

Always set a timeout yourself, as we did, so a stuck proxy fails fast instead of holding your job. Then check whether the network you are on blocks the proxy's port. The proxy connection timed out page goes through it step by step.

The tunnel opens and then drops

The proxy answered 200 to the tunnel request and closed the connection before the secure handshake with the site finished. The client sees a broken TLS handshake.

  • curl: curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to httpbin.org:443
  • Python requests: SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))
  • Node.js fetch: read ECONNRESET
  • Chrome: net::ERR_CONNECTION_CLOSED

curl's wording depends on the TLS library it was built with, so a Linux build words it differently. Retry with a new connection. If it keeps happening on one exit address, report it to the provider with the time and the destination.

The site answered with an error

If the tunnel opened and you still got an error status, the proxy did its job and the website decided. These have their own guides:

Reading the errors in each tool

curl's exit codes name the failing step. Its manual lists 5 as could not resolve proxy, 7 as failed to connect, 28 as a timeout, 35 as an SSL connect error, 52 as an empty reply, 56 as a failure receiving data and 97 as a proxy handshake error, which is where SOCKS failures land.

In Python requests, a ProxyError means the proxy itself refused or could not be reached, a ReadTimeout or ConnectTimeout means nothing answered in time, and an SSLError means the secure handshake failed. For plain HTTP sites a proxy's refusal comes back as an ordinary response, so check response.status_code or call response.raise_for_status().

Node.js hides the useful part. With proxy support switched on through NODE_USE_ENV_PROXY=1, every failure we caused surfaced as TypeError: fetch failed, and the reason sat in the error's cause, sometimes two levels deep. This prints the whole chain:

try {
  await fetch("https://httpbin.org/ip", { signal: AbortSignal.timeout(10000) });
} catch (e) {
  const chain = [];
  for (let c = e; c; c = c.cause) chain.push(`${c.name}: ${c.message}`);
  console.log(chain.join("  <-  "));
}

Run against our proxy that answers 403, a refused port and a name that does not exist, it printed:

TypeError: fetch failed  <-  Error: Request was cancelled.  <-  AbortError: Proxy response (403) !== 200 when HTTP Tunneling
TypeError: fetch failed  <-  Error: connect ECONNREFUSED 127.0.0.1:8199
TypeError: fetch failed  <-  Error: getaddrinfo ENOTFOUND no-such-proxy.invalid

Node.js also used a tunnel for plain http:// addresses in our test, so even those failures said "when HTTP Tunneling".

Chrome reports one net::ERR_ code and no detail. ERR_PROXY_CONNECTION_FAILED means it never reached the proxy, ERR_TUNNEL_CONNECTION_FAILED means the proxy refused the tunnel, ERR_INVALID_AUTH_CREDENTIALS means the login was missing or rejected, and ERR_CONNECTION_CLOSED means the connection dropped. Our test proxy sent its refusals with empty bodies, and for those Chrome showed ERR_HTTP_RESPONSE_CODE_FAILURE.

A two-minute triage

  1. Run the request through the proxy with curl and look at the exit code or the status.
  2. If it is 5 or 7, fix the host or the port.
  3. If it is a 407, fix the login.
  4. If the tunnel failed with 403 or 502, read the proxy's refusal as a statement about the destination or your account.
  5. If it timed out, try another network and check that the port is not blocked.
  6. If the tunnel opened and the site returned an error, the proxy is fine and the site's guide applies.

The quick start guide to testing a proxy with curl has the exact command, with the values from your order.

What we did not test

Our test proxies were small programs on our own machine, so the status codes and timings are ours. Commercial proxies send their own wording, and some send an error page with a body. We did not test Firefox or Safari, Windows builds of these tools, or proxies that inspect HTTPS with their own certificates, which produce certificate errors instead of any of the above.

Try it yourself

Create an account, add funds from US$1 and order a proxy in the country you need.

Keep reading