Setup & Troubleshooting

Common Proxy Errors and How to Fix Them

A troubleshooting guide to common proxy errors: 407, 403, 429, 502, 503, 504, ERR_PROXY_CONNECTION_FAILED, ERR_TUNNEL_CONNECTION_FAILED, timeouts, SSL errors and SOCKS failures.

By Team of Monkeys Editorial Updated 4 min read Affiliate disclosure

This guide contains affiliate links to Geonode. If you buy through them we may earn a commission, at no extra cost to you.

Start by asking: proxy or target?

Every proxy error comes from one of two places: the proxy (your connection to it, your authentication, or its connection onward) or the target website (blocking or rate-limiting you). The fastest way to tell is to run the same request through curl -v and see whether the error happens at the CONNECT stage or after. See curl proxy.

Error reference

ErrorSourceMost likely causeFix
407 Proxy Authentication RequiredProxyWrong or missing credentials; IP not whitelistedCheck credentials, URL-encode special characters, update whitelist
ERR_PROXY_CONNECTION_FAILED / ECONNREFUSEDProxyWrong host/port, proxy down, firewallVerify endpoint, try nc -vz host port, check firewall
ERR_TUNNEL_CONNECTION_FAILEDProxyCONNECT refused (auth, blocked target, provider restriction)Check auth; ask provider if the target domain is restricted
502 Bad GatewayProxyExit node or upstream failedRetry with a new session/IP
503 Service UnavailableProxy or targetOverloaded proxy, or target throttlingBack off, rotate
504 Gateway TimeoutProxyExit took too long to reach targetIncrease timeout, rotate, choose closer exits
403 ForbiddenTargetBlocked by the siteChange IP type, fix fingerprint, slow down
429 Too Many RequestsTargetRate limitedRespect Retry-After, spread load, rotate
TimeoutsEitherSlow exit, overloaded client, network issuesRotate, tune timeouts, check your server
SSL/TLS errorsProxyTLS-intercepting product (unblocker) or MITMUse provider's CA or verify=False only for trusted unblockers
ERR_SOCKS_CONNECTION_FAILEDProxySOCKS auth unsupported in client, wrong portWhitelist IP, use forwarder, check port
CAPTCHA page with 200 OKTargetSoft blockSee CAPTCHAs and proxies

407 in depth

  1. Typos and spaces in username or password.
  2. Special characters not URL-encoded (@ → %40, : → %3A, # → %23).
  3. The client isn't sending credentials (Chrome's --proxy-server flag ignores them).
  4. Your plan has expired or run out of traffic.
  5. You're using a whitelisting port with credentials or vice versa.
  6. Your public IP changed and isn't whitelisted.

See proxy authentication methods and Puppeteer proxy authentication.

Connection refused vs timeout

  • Refused: something actively rejected the connection: wrong port, nothing listening, or a protocol mismatch (HTTP to a SOCKS port).
  • Timeout: packets aren't getting through: firewall, wrong IP, or the proxy is down.
bash
nc -vz gate.example.com 7777

403 and 429: it's the target

The proxy is working; the target doesn't like the request. Fixes:

See avoiding IP bans when scraping.

Proxy tip: If you need a working proxy to test these steps with, Geonode generates endpoints in host:port:username:password format, supports IP whitelisting, and has a Chrome extension for quick switching. See using Geonode in your browser.

502/504: exit node problems

With residential and mobile proxies, exit devices can be slow or drop. Retry with a new session ID. If errors persist in one country or ASN, try broader targeting or contact the provider.

SSL errors

  • If you use a web unblocker that re-encrypts traffic, install the provider's CA certificate or disable verification for that client only.
  • If you see certificate errors through an ordinary proxy, be suspicious: something may be intercepting your traffic.

Language-specific gotchas

  • Python requests: dict keys must be "http" and "https"; install requests[socks] for SOCKS. See Python requests proxies.
  • Node axios: use https-proxy-agent with proxy: false for HTTPS targets. See Node.js proxies.
  • curl: lowercase http_proxy only. See curl proxy.
  • Selenium/Chrome: no credentials in the flag. See Selenium proxies.

A step-by-step diagnostic flow

  1. Can you reach the proxy? nc -vz host port. If not: host, port, firewall.
  2. Does authentication work? curl -v -x ... https://api.ipify.org. A 407 means credentials or whitelist.
  3. Does a simple HTTPS site work? If not: CONNECT blocked or provider restriction.
  4. Does your target work? If not: target blocking; check IP type, rate and fingerprint.
  5. Does it work in curl but not your code? Library configuration issue.

The exact messages, by tool

Error text varies by tool, which makes searching for help harder. Here's how the most common problems actually appear:

ToolMessage you'll seeUsually means
curl(7) Failed to connect to ...Wrong host or port, proxy down, or firewall
curl(56) CONNECT tunnel failed, response 407Proxy credentials missing or wrong
curl(97) Proxy handshake errorSOCKS handshake failed: wrong port, protocol or credentials
Python requestsProxyError ... Unable to connect to proxyWrong host or port, or firewall
Python requestsTunnel connection failed: 407 Proxy Authentication RequiredCredentials, often a special character not URL-encoded
Python requestsInvalidSchema: Missing dependencies for SOCKS supportInstall requests[socks]
Python requestsSSLError ... CERTIFICATE_VERIFY_FAILEDAn intercepting proxy or corporate TLS inspection
Node.js (undici)Proxy response (407) !== 200 when HTTP TunnelingCredentials missing or wrong
Node.jsECONNREFUSED, ETIMEDOUT, ECONNRESETEndpoint, timeout or dropped connection, as in the table above

Two tips make any of these faster to solve:

  1. Reproduce with curl -v. If curl shows the same failure with the same proxy, the problem is the proxy or your network, not your code.
  2. Copy the full message when asking for help, with the tool and version. "It doesn't work" can't be searched; (56) CONNECT tunnel failed, response 407 can.

For credentials problems in depth, see proxy authentication methods. For language specifics, see Python requests proxies and Node.js proxies, and for curl itself, curl proxy.

FAQ

How do I know if the proxy or the website is blocking me?

If the error occurs before the tunnel is established (407, connection refused, tunnel failed), it's the proxy. If you get a response from the site (403, 429, CAPTCHA), it's the target.

Why do errors happen only at certain times?

Residential pools fluctuate with time zones, and targets may tighten protection at peak times.

Affiliate disclosure: Team of Monkeys is a Geonode affiliate. Links and banners marked as sponsored, and links to Geonode in the text, use our referral link, and we may earn a commission if you buy through them, at no extra cost to you. Our explanations and comparisons are written to be useful whichever provider you choose.

Editorial note: Proxy providers change their pools, features and prices often, so treat any figures here as typical ranges at the time of writing and confirm current terms with the provider before you buy.