A proxy error code is a status in the proxy's own reply, and it is easy to confuse with the website's. For an HTTPS page there are two: the proxy answers your CONNECT first (200, 407 for bad credentials, a 5xx when it cannot reach the host), then the site answers your request (403, 404, 429, 500). Read which one failed before you change anything.
Everything below comes from requests we sent on 20 November 2026 with curl.exe 8.22.0 and Python Requests on Windows 11, through three QuanticData networks: Residential Basic, Residential Premium and Mobile. Ten cases per network, 30 in all, against httpbin.org, a public test service that returns whatever status you ask for. Exit IPs are masked; USER and PASS stand for the credentials.
Two status codes in one HTTPS request
When you fetch an https:// URL through an HTTP proxy, your client first asks the proxy to open a tunnel with CONNECT host:443. The proxy replies with a status line of its own. Only after a 200 does TLS start, end to end between you and the site, and the site's status comes back through the tunnel; the proxy cannot read it or change it. curl prints both if you ask for them:
curl.exe -s -o NUL -w "%{http_connect} %{http_code}\n" -x http://residentialpremium.quanticdata.io:8080 -U "USER:PASS" https://httpbin.org/status/429
200 429
curl.exe -s -o NUL -w "%{http_connect} %{http_code}\n" -x http://residentialpremium.quanticdata.io:8080 -U "USER:wrongpass" https://httpbin.org/status/200
407 000
The first line says the proxy opened the tunnel (200) and the site refused the request (429). The second says the proxy refused us (407), so the site was never reached and curl reports 000 for it. Most "proxy errors" people report are the first kind: a code from the website that travelled through a proxy that worked.
What we got, case by case
| Case | CONNECT reply (proxy) | Page status (site) | Who sent the error |
|---|---|---|---|
| Working request | 200 Connection established | 200 | Nobody |
| Wrong password | 407 Proxy Authentication Required | none (000) | The proxy |
| Host that does not exist | A 5xx on all three networks | none (000) | The proxy |
| Site returns 403 | 200 | 403 | The site |
| Site returns 404 | 200 | 404 | The site |
| Site returns 429 | 200 | 429 | The site |
| Site returns 500, 502 or 503 | 200 | 500, 502 or 503 | The site |
| Plain http:// URL, site returns 500 | no CONNECT | 500 | The site, relayed by the proxy |
The site's codes were the same on all three networks: the proxy passed them on untouched. The proxy's own codes appeared only when the problem was the login or the destination host.
Codes the proxy sends
407 Proxy Authentication Required
The gateway did not accept the username and password, or got none. All three networks answered a wrong password in 138 to 252 milliseconds with a Proxy-Authenticate: Basic header, so a 407 is fast and certain: no request reached the site and no exit IP was used. Python Requests turns it into an exception instead of a status:
requests.exceptions.ProxyError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /ip
(Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))
Check the username first: on our networks the country, session and lifetime live inside it, and one wrong character is a different, unknown user. The full walk-through is in how to fix 407 Proxy Authentication Required, and the exception itself in requests.exceptions.ProxyError.
5xx on CONNECT: the gateway could not reach the host
A 5xx in the CONNECT reply means the proxy accepted you but could not open a connection to the host you named. For a hostname that does not exist, all three networks answered the CONNECT with a 5xx and never opened the tunnel. Under the HTTP standard the usual codes are 502 Bad Gateway (the next server gave an invalid answer), 503 Service Unavailable (the destination cannot be served right now) and 504 Gateway Timeout (it did not answer in time). Whichever one you get, the cure is on your side: check the spelling of the host, whether it resolves from a normal browser, and the port. Retrying the same host on a new IP does not fix a name that does not exist.
502 and 504 from a proxy
By the HTTP standard, a 502 Bad Gateway from a proxy means it got an invalid answer from the next server, and a 504 Gateway Timeout means that server did not answer in time. In our tests every 502 came from the site, inside the tunnel, with a 200 on CONNECT. That is the first thing to check when you see one: print %{http_connect} and you know which side it was.
Codes the website sends through the proxy
| Code | What it means for a scraper | What to do |
|---|---|---|
| 301, 302, 307 | The page moved | Follow the Location header; store the new URL for a 301 |
| 304 Not Modified | Your copy is current | Reuse it; on books.toscrape.com a repeat request with If-None-Match got 304 and 0 bytes instead of 51,294 |
| 400 Bad Request | The request itself is malformed | Check the URL encoding, the body and the headers; a new IP will not change it |
| 401 Unauthorized | The site wants its own login | Not a proxy problem. Pages behind a login are outside what a proxy is for |
| 403 Forbidden | The site refused this client | Read the block page; see web scraping 403 Forbidden |
| 404 Not Found | No such page | Drop the URL; retrying is wasted traffic |
| 429 Too Many Requests | Too fast for the site's limit | Slow down and honour Retry-After; see 429 Too Many Requests when scraping |
| 500 Internal Server Error | The site failed while answering | Retry a few times with backoff, then skip |
| 502, 503, 504 | The site, or a server in front of it, is overloaded or down | Retry with backoff and honour Retry-After on 503 |
Rate limits sometimes arrive with a code of their own instead of 429: Cloudflare shows Cloudflare error 1015, for example. The logic is the same: slow down.
Plain http:// URLs: one status, two possible senders
For an http:// URL there is no CONNECT. The proxy forwards the request and relays the site's reply, so you see one status line: our 500 from httpbin.org arrived as a plain HTTP/1.1 500 Internal Server Error. To tell a site error from a proxy error here, look at the body and the headers: a site's error page carries the site's own headers and HTML. Most sites now redirect to https anyway, and then you are back to two codes.
Retry the right codes, not every code
A scraper should retry 429, 500, 502, 503 and 504, wait longer each time, and give up after a few tries. It should not retry 400, 401, 403 or 404: the answer will be the same. In Python Requests this is a few lines with urllib3's Retry:
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
retry = Retry(total=3, backoff_factor=1, status_forcelist=[429, 500, 502, 503, 504],
allowed_methods=["GET", "HEAD"], respect_retry_after_header=True)
s = requests.Session()
s.mount("https://", HTTPAdapter(max_retries=retry))
proxy = "http://USER:PASS@residentialpremium.quanticdata.io:8080"
s.proxies = {"http": proxy, "https": proxy}
s.get("https://httpbin.org/status/503") # RetryError after 8.3 s: too many 503 error responses
s.get("https://httpbin.org/status/404") # 404 at once (0.3 s), not retried
Three retries with a backoff factor of 1 spent 8.3 seconds on the 503 before giving up, and the 404 came back in 0.3 seconds because it was not in the list. Keep the 407 out of the list too: a wrong password stays wrong.
When the error is the site saying no
A 403 or a run of 429s on a page that loads in your own browser usually means the site does not like the client or the pace, not that the proxy is broken. Slow down first. For public pages that need a real browser, see the Web Unlocker. For the plain network, residential proxies and mobile proxies give you home and carrier IPs in the country you pick, and the proxy not working checklist walks through the rest layer by layer. For the curl options used above, see how to use a proxy with curl.
None of this changes what a site allows. A proxy is for public pages you are permitted to fetch: respect robots.txt, the site's terms and its rate limits, and leave pages behind a login alone.


