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_
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 failA 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- 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.
- Check the credentials and their format. Most tools expect
http://. Special characters in the password must be URL-encoded in that format.USERNAME: PASSWORD@ host:port - 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.
- 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.
- Compare with no proxy. If the site also fails without the proxy, the problem is the site or your network, not the proxy.
- Try another target. If one site fails and others work through the same proxy, the site is blocking or failing, not the proxy.
- Get a fresh IP. Rotate the session or start a new one. If the error disappears, the previous IP was blocked or went offline.
- Check your account. Remaining bandwidth, the product you are using and any location targeting you set.
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, explainedHTTP 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.
| Code | What it means | Usually caused by | How to fix it |
|---|---|---|---|
| 400 Bad Request | The server could not understand the request | Malformed request, bad headers, wrong proxy scheme | Check the request and the proxy URL format; test with curl |
| 403 Forbidden | The server understood the request but refuses it | The website blocking the IP, region or client | Rotate to a residential or mobile IP, use a realistic client, slow down |
| 404 Not Found | The page does not exist | A wrong URL, not the proxy | Check the URL; a proxy cannot fix a missing page |
| 407 Proxy Authentication Required | The client must authenticate to the proxy | Missing or wrong username or password, wrong format | Re-enter credentials, URL-encode special characters |
| 408 Request Timeout | The server closed a request that took too long | Slow client, stalled upload, long idle connection | Send requests promptly; raise client timeouts only if needed |
| 429 Too Many Requests | Too many requests in a given time (rate limiting) | The website’s rate limit on your IP or account | Honour Retry-After, back off, spread requests over more IPs |
| 500 Internal Server Error | The server hit an unexpected condition | A bug or overload on the website | Retry later with backoff; nothing to fix on the proxy |
| 502 Bad Gateway | A gateway or proxy got an invalid response from the server behind it | The site failing, or the exit IP unable to complete the request | Retry, rotate the IP, check the site loads without the proxy |
| 503 Service Unavailable | The server is temporarily overloaded or in maintenance | The website, or a temporarily busy route | Retry with backoff, honour Retry-After |
| 504 Gateway Timeout | A gateway or proxy did not get a timely response from upstream | A slow site, a slow exit IP, very long requests | Retry, 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 messagesBrowsers 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.
| Error | What it means | How to fix it |
|---|---|---|
| ERR_ | Could not create a connection to the proxy server, either resolving its name or connecting to it | Check the proxy host and port, your internet connection, and firewall or antivirus rules |
| ERR_ | A tunnel connection through the proxy could not be established | Check credentials, the target port, and whether the proxy allows that destination |
| ERR_ | The proxy asked for an authentication method the browser does not support | Use username and password authentication, or an extension or tool that supports it |
| ERR_ | The certificate presented by an HTTPS proxy was invalid | Check the proxy scheme and address; don’t install unknown certificates |
| ERR_ | Failed to connect to the SOCKS proxy for a target host | Check the SOCKS host, port and credentials, then the target |
| ERR_ | The connection was reset (a TCP reset) | Retry; if it repeats, test without the proxy and check security software |
| ERR_ | A connection attempt timed out | Check the proxy is reachable and the port is not blocked on your network |
| ERR_ | The host name could not be resolved | Check the spelling of the proxy host or website |
| Firefox: “The proxy server is refusing connections” | Firefox could not connect to the configured proxy | Check 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_
SOCKS5 Proxy Errors
Reply codes from RFC 1928SOCKS5 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.
| Code | Meaning | Usually caused by |
|---|---|---|
| 0x00 | Succeeded | No error |
| 0x01 | General SOCKS server failure | A problem on the proxy side; retry or rotate |
| 0x02 | Connection not allowed by ruleset | The proxy does not allow that destination or port |
| 0x03 | Network unreachable | No route to the target network from the exit |
| 0x04 | Host unreachable | The target host is down or unreachable |
| 0x05 | Connection refused | The target refused the connection on that port |
| 0x06 | TTL expired | The connection attempt took too long |
| 0x07 | Command not supported | The client asked for a SOCKS command the proxy does not offer |
| 0x08 | Address type not supported | For 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 ashttps://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 printcurl 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::. Chromium does not accept credentials in the proxy URL, so pass the username and password through the library’s own authentication option.
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 errorsSome 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 botsKey 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 answersWhat 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- RFC 9110: HTTP SemanticsStatus codes 400 to 504, including 407 Proxy Authentication Required (section 15.5.8)
- RFC 6585: Additional HTTP Status Codes429 Too Many Requests and Retry-After
- RFC 1928: SOCKS Protocol Version 5Authentication methods and reply codes
- net_error_list.hChromium network error definitions (ERR_ codes)
- 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.



