Proxy Error Codes: What They Mean, What Causes Them and How to Fix Them

Troubleshooting guide Β· Last reviewed 28 September 2026 Β· 13 min read

A proxy error is any failure that happens when a request travels through a proxy server: the client cannot reach the proxy, the proxy rejects your credentials, the proxy cannot reach the website, or the website refuses the request it receives. This guide explains every common proxy error code, from HTTP 407 and 502 to ERR_TUNNEL_CONNECTION_FAILED and SOCKS5 reply codes, what causes each one and how to fix it. Use the free proxy checker to test a proxy while you work through it.

The short version

Every proxy error comes from one of three places: your client, the proxy, or the website behind it, and the code tells you which. 407 means the proxy did not accept your credentials. 502 and 504 and “tunnel connection failed” mean the proxy could not reach the site. 403 and 429 usually come from the website itself. Find the source first, then apply the fix for that hop.

What Is a Proxy Error?

Three hops, three places to fail

A request through a proxy makes two trips instead of one. Your browser, script or tool first connects to the proxy server and, on most paid proxies, proves who you are with a username and password. The proxy then connects to the website on your behalf, sends the request, and passes the website’s answer back to you.

That gives three places where something can go wrong, and each produces a different kind of error:

  • Client to proxy. Wrong host or port, the proxy is unreachable, or the credentials are wrong. Typical errors: ERR_PROXY_CONNECTION_FAILED, “The proxy server is refusing connections”, HTTP 407.
  • Proxy to website. The proxy cannot resolve, reach or get a valid answer from the site. Typical errors: HTTP 502 and 504, ERR_TUNNEL_CONNECTION_FAILED, SOCKS5 “host unreachable”.
  • The website’s answer. The site received your request and refused it or failed. Typical errors: HTTP 403, 429, 500 and 503, passed back through the proxy unchanged.

Before you fix anything, find out who is complaining: your client, the proxy, or the website.

Status codes in the 2xx and 3xx ranges are not errors. A 204 No Content or 206 Partial Content is a successful response, and 301 or 302 redirects only tell the client to follow a new location. If a redirect loops, check the client’s redirect settings and cookies rather than the proxy.

Quick Proxy Troubleshooting Checklist

Work through it in order
  1. Check the host and port. Copy them again from your provider’s dashboard. A single wrong digit in the port gives a connection error, not a helpful message.
  2. Check the credentials and their format. Most tools expect http://USERNAME:PASSWORD@host:port. Special characters in the password must be URL-encoded in that format.
  3. Match the protocol. An HTTP client pointed at a SOCKS5 endpoint, or the reverse, fails at the first byte. Use the scheme your provider gives for that port.
  4. Test from the command line. Run the request with curl in verbose mode. It shows whether the failure is the connection, the CONNECT tunnel or the site’s response.
  5. Compare with no proxy. If the site also fails without the proxy, the problem is the site or your network, not the proxy.
  6. Try another target. If one site fails and others work through the same proxy, the site is blocking or failing, not the proxy.
  7. Get a fresh IP. Rotate the session or start a new one. If the error disappears, the previous IP was blocked or went offline.
  8. Check your account. Remaining bandwidth, the product you are using and any location targeting you set.
Test a proxy with curl (verbose)
curl -v -x http://USERNAME:PASSWORD@v2.proxyempire.io:5000 https://example.com -o /dev/null

# Look for these lines in the output:
#   "Connected to v2.proxyempire.io"    -> client reached the proxy
#   "CONNECT tunnel failed, response 407" -> credentials rejected
#   "HTTP/1.1 200 Connection established" -> tunnel is open
#   "HTTP/2 403" or "HTTP/2 429"         -> the website's answer

More curl options are in our guide to using curl with a proxy.

HTTP Proxy Error Codes and How to Fix Them

4xx and 5xx responses, explained

HTTP status codes are defined in RFC 9110, with 429 in RFC 6585. The same code can come from the proxy or from the website, so the “usually caused by” column matters as much as the definition.

CodeWhat it meansUsually caused byHow to fix it
400 Bad RequestThe server could not understand the requestMalformed request, bad headers, wrong proxy schemeCheck the request and the proxy URL format; test with curl
403 ForbiddenThe server understood the request but refuses itThe website blocking the IP, region or clientRotate to a residential or mobile IP, use a realistic client, slow down
404 Not FoundThe page does not existA wrong URL, not the proxyCheck the URL; a proxy cannot fix a missing page
407 Proxy Authentication RequiredThe client must authenticate to the proxyMissing or wrong username or password, wrong formatRe-enter credentials, URL-encode special characters
408 Request TimeoutThe server closed a request that took too longSlow client, stalled upload, long idle connectionSend requests promptly; raise client timeouts only if needed
429 Too Many RequestsToo many requests in a given time (rate limiting)The website’s rate limit on your IP or accountHonour Retry-After, back off, spread requests over more IPs
500 Internal Server ErrorThe server hit an unexpected conditionA bug or overload on the websiteRetry later with backoff; nothing to fix on the proxy
502 Bad GatewayA gateway or proxy got an invalid response from the server behind itThe site failing, or the exit IP unable to complete the requestRetry, rotate the IP, check the site loads without the proxy
503 Service UnavailableThe server is temporarily overloaded or in maintenanceThe website, or a temporarily busy routeRetry with backoff, honour Retry-After
504 Gateway TimeoutA gateway or proxy did not get a timely response from upstreamA slow site, a slow exit IP, very long requestsRetry, rotate the IP, raise timeouts for slow pages

407 Proxy Authentication Required

The proxy is reachable but has not accepted who you are. On a username-and-password proxy, it almost always means the credentials are missing, mistyped or in the wrong format for your tool. Copy them again, check that special characters are URL-encoded, and make sure the tool actually sends proxy authentication. Some tools only send it after a first 407 challenge, and some need it set separately for HTTP and HTTPS. We cover .NET and C# in detail in our guide to fixing HTTP 407 errors. If your proxies are from ProxyEmpire and you work in Claude, ChatGPT or Cursor, the ProxyEmpire MCP server can check a 407 for you: it looks at your package, credentials, remaining bandwidth and the pool, and tells you which one to fix.

502 Bad Gateway and 504 Gateway Timeout

Both mean the proxy reached out and did not get a usable answer. A 502 is an invalid response, a 504 is no response in time. Check whether the site loads without the proxy first. If it does, rotate to a new IP, since a single exit can be slow or unable to reach a particular site, and give slow pages a longer timeout.

403 Forbidden and 429 Too Many Requests

These usually come from the website, not the proxy. A 403 through a proxy often means the site blocks that IP range, that country, or requests that do not look like a normal browser. A 429 is a rate limit: slow down, read the Retry-After header if the site sends one, and spread requests across more IPs with rotating residential proxies.

Browser Proxy Errors

Chrome, Edge and Firefox messages

Browsers show their own error names instead of HTTP codes when the failure happens before a normal response. Chrome and Edge use Chromium’s network error list; the descriptions below are Chromium’s own.

ErrorWhat it meansHow to fix it
ERR_PROXY_CONNECTION_FAILEDCould not create a connection to the proxy server, either resolving its name or connecting to itCheck the proxy host and port, your internet connection, and firewall or antivirus rules
ERR_TUNNEL_CONNECTION_FAILEDA tunnel connection through the proxy could not be establishedCheck credentials, the target port, and whether the proxy allows that destination
ERR_PROXY_AUTH_UNSUPPORTEDThe proxy asked for an authentication method the browser does not supportUse username and password authentication, or an extension or tool that supports it
ERR_PROXY_CERTIFICATE_INVALIDThe certificate presented by an HTTPS proxy was invalidCheck the proxy scheme and address; don’t install unknown certificates
ERR_SOCKS_CONNECTION_FAILEDFailed to connect to the SOCKS proxy for a target hostCheck the SOCKS host, port and credentials, then the target
ERR_CONNECTION_RESETThe connection was reset (a TCP reset)Retry; if it repeats, test without the proxy and check security software
ERR_CONNECTION_TIMED_OUTA connection attempt timed outCheck the proxy is reachable and the port is not blocked on your network
ERR_NAME_NOT_RESOLVEDThe host name could not be resolvedCheck the spelling of the proxy host or website
Firefox: “The proxy server is refusing connections”Firefox could not connect to the configured proxyCheck the proxy settings in Firefox’s connection settings, host, port and credentials

How to fix ERR_TUNNEL_CONNECTION_FAILED

For HTTPS sites, the browser asks the proxy to open a tunnel with a CONNECT request. ERR_TUNNEL_CONNECTION_FAILED means that tunnel was never opened. In order of likelihood: the proxy rejected your credentials, the proxy does not allow connections to that destination or port, or the exit could not reach the site. Test the same proxy with curl in verbose mode: a “CONNECT tunnel failed, response 407” line points to credentials, any other response code to the destination. If you set a proxy by mistake, turn it off in the browser or system proxy settings; our guide to Chrome proxy settings shows where.

SOCKS5 Proxy Errors

Reply codes from RFC 1928

SOCKS5 does not use HTTP status codes. After a connection request, the server answers with a one-byte reply code defined in RFC 1928. Tools print it in different ways, but the meaning is the same.

CodeMeaningUsually caused by
0x00SucceededNo error
0x01General SOCKS server failureA problem on the proxy side; retry or rotate
0x02Connection not allowed by rulesetThe proxy does not allow that destination or port
0x03Network unreachableNo route to the target network from the exit
0x04Host unreachableThe target host is down or unreachable
0x05Connection refusedThe target refused the connection on that port
0x06TTL expiredThe connection attempt took too long
0x07Command not supportedThe client asked for a SOCKS command the proxy does not offer
0x08Address type not supportedFor example, an IPv6 address on a proxy that only supports IPv4

Authentication problems show up earlier. If the server answers the method negotiation with 0xFF, “no acceptable methods”, the client did not offer a method the server accepts. On a username-and-password proxy, that usually means the client is not sending credentials at all.

SSL, TLS and Certificate Errors Through a Proxy

When the encryption layer fails

“SSL handshake failed” and similar errors mean the encrypted connection could not be set up. Through a proxy, the most common causes are:

  • The wrong proxy scheme. Most proxies are addressed with http:// even for HTTPS websites; the HTTPS connection to the site runs inside the CONNECT tunnel. Setting the proxy itself as https:// when it expects plain HTTP breaks the handshake.
  • Traffic inspection. Corporate firewalls and some security software intercept HTTPS and present their own certificates, which a script will reject.
  • An old client. Outdated TLS libraries cannot negotiate with modern sites. Update the client or runtime.
  • A wrong system clock. Certificates are time-bound, so a clock that is far off makes valid certificates look invalid.

Avoid turning off certificate verification to make the error go away. It hides the problem and exposes your traffic.

Proxy Errors in Code: curl, Python and Headless Browsers

What your tools print

curl reports a numeric exit code plus a message. Exit code 7 means it could not connect to the host or proxy. Exit code 56 is a failure receiving network data, which through a proxy often appears as “CONNECT tunnel failed, response 407” or with another status code.

Python requests raises ProxyError when it cannot connect to the proxy or the proxy refuses the tunnel, SSLError for handshake problems, and ConnectTimeout or ReadTimeout for slow hops. Responses such as 403 and 429 are not exceptions: check response.status_code. Our Python requests proxy guide covers setup.

Puppeteer and Playwright surface Chromium’s errors with a net:: prefix, such as net::ERR_TUNNEL_CONNECTION_FAILED. Chromium does not accept credentials in the proxy URL, so pass the username and password through the library’s own authentication option.

Python: retry with backoff and a fresh IP on proxy errors
import random, time
import requests

PROXY = "http://USERNAME:PASSWORD@v2.proxyempire.io:5000"
RETRY_STATUS = {429, 500, 502, 503, 504}

def fetch(url, attempts=4):
    for attempt in range(attempts):
        try:
            r = requests.get(url, proxies={"http": PROXY, "https": PROXY}, timeout=30)
        except (requests.exceptions.ProxyError,
                requests.exceptions.ConnectTimeout,
                requests.exceptions.ReadTimeout):
            r = None                      # connection-level failure: retry
        if r is not None and r.status_code not in RETRY_STATUS:
            return r                      # success, or an error retrying won't fix
        wait = 2 ** attempt + random.random()
        if r is not None and r.headers.get("Retry-After", "").isdigit():
            wait = int(r.headers["Retry-After"])
        time.sleep(wait)                  # each new request can leave from a new IP
    raise RuntimeError(f"gave up on {url}")

With a rotating proxy set to a new IP per request, each retry above automatically leaves from a different address. A 407 is deliberately not retried: wrong credentials will not fix themselves.

Causes Specific to Your Proxy Provider

Rules and limits that look like errors

Some failures come from how a proxy service is set up rather than from the network. Using ProxyEmpire as the example:

  • Authentication is username and password only. There is no IP whitelisting, so a 407 always points to credentials or how your tool sends them.
  • Destination ports 80 and 443 are open by default. Other ports can be opened on request after a verification (KYC) and use-case review. Mail ports are never opened: port 25 and the other email ports stay blocked on every product, so the proxies can’t send email (see Port 25 usage). A tunnel failure to an unusual port is expected, not a fault.
  • Some site categories are blocked on every product. Financial, government and other high-risk sites, such as banks, payment processors and crypto exchanges, are refused by default and can only be enabled after KYC and a use-case review.
  • Sticky sessions follow a real device. A sticky IP stays until you rotate it or the device behind it goes offline. When it goes offline, requests on that session fail; start a new session to continue. Our guide to sticky and rotating proxies explains the trade-off.
  • Bandwidth and targeting. Check your remaining bandwidth in the dashboard, and remember that very narrow targeting, such as a small city on one ISP, has fewer IPs to rotate through.

Still stuck? ProxyEmpire’s support team is available 24/7 and is made up of real people. Include the full error message, the time, and the proxy settings you used, without your password.

How to Prevent Proxy Errors at Scale

Habits for reliable scrapers and bots

Key takeaways

  • Set explicit connect and read timeouts; a stuck request is worse than a failed one.
  • Retry connection errors and 429 or 5xx responses with exponential backoff and jitter, and honour Retry-After.
  • Never retry 407 or 404 automatically: fix the credentials or the URL.
  • Rotate to a new IP on 403 and 429, and slow down per website rather than per proxy.
  • Cap concurrency per target site, not only overall.
  • Log the status code, target, exit country and timestamp of every failure, and alert on error-rate changes.

Error rates are also your earliest warning. A jump in 403s on one site means it changed its defences; a jump in timeouts across every site points to your own network or the proxy route. Tracking both separately saves hours of guessing.

Proxy Error FAQ

Straight answers
What does “proxy error” mean?

It means a request failed somewhere on its way through a proxy server: your device could not reach the proxy, the proxy did not accept your credentials, the proxy could not reach the website, or the website refused the request. The error code tells you which of these happened.

How do I fix a proxy error?

Check the proxy host, port and credentials first, then test the same request with curl in verbose mode. Compare with a request without the proxy, try a different website, and rotate to a new IP. Most proxy errors are solved by one of these steps.

What is error 407 Proxy Authentication Required?

The proxy needs you to authenticate and did not accept what it received. Re-enter the username and password, URL-encode any special characters, and make sure your tool sends proxy authentication for both HTTP and HTTPS requests.

What causes ERR_TUNNEL_CONNECTION_FAILED?

The browser could not open a CONNECT tunnel through the proxy to an HTTPS site. The usual causes are rejected credentials, a destination or port the proxy does not allow, or an exit that cannot reach the site.

What is the difference between a 502 and a 504 proxy error?

Both mean the proxy did not get a usable answer from the website. A 502 means it received an invalid response; a 504 means it received no response in time.

Why do I get 403 errors only through a proxy?

The website is refusing the proxy’s IP range, its country, or requests that don’t look like a normal browser. Residential or mobile IPs, a realistic client and a slower request rate usually help.

Are free proxies more likely to cause errors?

Yes. Public proxies are shared by many users, go offline often and are widely blocked, so connection failures, timeouts and 403 responses are common. They can also log or change your traffic.

References

Primary documentation
  1. RFC 9110: HTTP SemanticsStatus codes 400 to 504, including 407 Proxy Authentication Required (section 15.5.8)
  2. RFC 6585: Additional HTTP Status Codes429 Too Many Requests and Retry-After
  3. RFC 1928: SOCKS Protocol Version 5Authentication methods and reply codes
  4. net_error_list.hChromium network error definitions (ERR_ codes)
  5. libcurl error codescurl exit codes such as 7 and 56

Proxies that stay connected

Rotating residential and 4G mobile proxies with a new IP per request or sticky sessions, HTTP(S) and SOCKS5, no concurrent session limit and 24/7 support from real people when something breaks. Try it for $1.97.

ProxyEmpire proxy types and prices

ProxyEmpire

Proxies for data collection at scale.

Residential, mobile, ISP and datacenter proxies for scraping, ad verification, SEO monitoring and multi-account work. Choose from 30M+ ethically sourced residential IPs and 4M+ 4G/5G mobile IPs in 170+ countries, target by country, city, ZIP, ISP or carrier, and connect over HTTP(S) or SOCKS5 with 99.9% uptime. Try residential and mobile proxies for $1.97.

🏘️ Rotating Residential Proxies
  • 30M+ Premium Residential IPs
  • Β 170+ Countries
    Every residential IP in our network corresponds to an actual desktop device with a precise geographical location. Our residential proxies are fast and reliable, with 99.9% uptime, and work for a wide range of use cases. You can use country, region, city, ZIP, ISP, ASN and OS fingerprint targeting for our rotating residential proxies, at no extra charge.

See our Rotating Residential Proxies

πŸ“ Static Residential Proxies
  • 24 Countries
    Buy a dedicated static residential IP from one of the 24 countries that we offer proxies in. Keep the same IP for a month or longer, while benefiting from their fast speed and stability.

See our Static Residential Proxies

πŸ“³ Rotating Mobile Proxies
  • 4M+ Premium Mobile IPs
  • Β 170+ Countries
    Access millions of clean mobile IPs with precise targeting by country, region, city, ZIP, mobile carrier, ASN and OS fingerprint, at no extra charge. Get far fewer IP blocks and CAPTCHAs with our 4G and 5G proxies.

See our Mobile Proxies

πŸ“± Dedicated Mobile Proxies
  • 4 Countries
  • 50+ Locations
    Get your own dedicated mobile proxy in one of our supported locations, with unlimited bandwidth and unlimited IP changes on demand. A great choice when you need a small number of mobile IPs and a lot of proxy bandwidth.

See our 4G & 5G Proxies

🌐 Rotating Datacenter Proxies
  • 197,000+ IPs Premium IPs
  • Β 62 Countries
    On a budget and need to do some simple scraping tasks? Our datacenter proxies are the perfect fit! Get started with as little as $2

See our Datacenter Proxies

♾️ Unlimited Residential Proxies
  • 1M+ Daily Residential IPs
  • 85+ Countries
    Our unlimited residential proxies bill by connection speed, not gigabytes: 100 to 1000 Mbit with unlimited bandwidth, on daily, weekly or monthly plans. Ask us for a 1-hour trial at 50 Mbit before you pick a plan.

See our Unlimited Residential Proxies

proxy locations

30M+ rotating IPs

99.9% uptime - high speed

99.9% uptime.

dedicated support team

24/7 Dedicated Support.

fair price

Fair Pricing.

🏠 Residential Proxies Rotating / Static / Unlimited
πŸ“± Mobile Proxies Rotating and Dedicated
πŸ–₯️ Datacenter Proxies Rotating
🌍 IP Pool 30M+ residential + 4M+ mobile IPs
πŸ“Ά Uptime 99.9% Β· Live status
πŸ’³ Payment Card Β· PayPal Β· Crypto Β· Bank transfer
πŸ’¬ Support 24/7 live chat Β· sales@proxyempire.io