What to change
407: copy the login and password again from your account, check the location part of the username, or add your current IP to the allowlist.402: top up in your account; your traffic never expires, and a new purchase adds to the remaining balance.502: try again in a few seconds; check the city name against the list in your dashboard, or widen it to the region or country.- SOCKS5: an authentication failure is fixed like a
407or a402; reply0x04like a502. - A
403comes from the site through the proxy: change the request, not the login (tables below).
To see which response the gateway sends, run one request with -v:
curl -v -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.orgWhat each status code means in general: HTTP response status codes (MDN).
On this page 12 sections
Is it the proxy or the website? Diagnose in 4 steps
Four checks tell you which side failed.
Test the proxy alone. Use the proxy checker, or send one request with the credentials from your account:
curl -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.orgAn IP address back means the proxy works.
Read the status code and who sent it (next section): 407 and most 502/504 pages come from the proxy side; a 403, 404 or 429 with the site's branding, or a Cloudflare page, comes from the target.
Try the URL without the proxy, then from another location. Failing everywhere means the site is down or refuses everyone; one location failing means a regional block.
Check your account: username and password, the allowlist, and remaining traffic (the dashboard shows real-time usage stats and remaining gigabytes).
Read the status code and who sent it
HTTP's standard, RFC 9110 §3.7, names two kinds of intermediary: a proxy, which the client chooses (your scraper sends requests to gate.proxyfield.io:7000), and a gateway (reverse proxy), which acts as the origin server for the site, such as Cloudflare in front of a website. Both can answer with their own status codes, which is why the same 502 can come from either side.
Three rules settle most cases:
- The site's own answer passes through. A 403, 404 or 429 from the website reaches you unchanged; the proxy did its job.
- The proxy answers itself only when it cannot complete the request: 407 (no valid login), 502 (no valid answer from the server behind it), 504 (no answer in time), or a provider's own code.
- A connection failure has no code at all: the client never reached the proxy, or got no reply. Python and cURL report it as an exception or an exit code.
To see which side spoke, print the headers with curl -i:
curl -i -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://example.com/For an https:// URL the client first asks the proxy to open a tunnel (CONNECT), so the output can hold two header blocks:
| What you see | Who sent it |
|---|---|
The first block, the answer to CONNECT: 200 (tunnel open, wording varies) or 407 | The proxy |
| The second block, after the tunnel opened: 200, 403, 404, 429… | The website, or the CDN in front of it |
Server: cloudflare and a CF-RAY header, with an error number on the page | Cloudflare, the site's gateway |
A Via header, or a Proxy-Status header with an error type such as connection_timeout (RFC 9209) | An intermediary that added it; not every proxy sends these |
No status line, only a cURL exit code such as curl: (7) or curl: (28) | Nobody: a connection failure |
For http:// URLs there is no tunnel: a 407 arrives as an ordinary response with a Proxy-Authenticate header.
Proxy error codes and HTTP status codes for scrapers
A 4xx code means a request was refused; a 5xx code means a server failed, the proxy or the site. Each code links its MDN definition, and the single-code docs go deeper.
| Code | Sent by | What it means for a scraper | First fix |
|---|---|---|---|
| 401 Unauthorized (MDN) | Target | The site wants its own login (WWW-Authenticate); your proxy login is not involved. | Log in to the site, or send the site's credentials or token. |
| 403 Forbidden (MDN) | Target | The site refuses the request: headers, IP reputation or a firewall rule. | Match a real browser's headers; see 403 Forbidden. |
| 404 Not Found (MDN) | Target | The page does not exist on the site. A proxy does not invent a 404. | Check the URL; retrying through another IP will not help. |
| 407 Proxy Authentication Required (MDN) | Proxy | The proxy needs valid credentials first. It sends Proxy-Authenticate; your client must answer with Proxy-Authorization, not the site's Authorization header. | Check the username, password and allowlist; URL-encode @, : and / in a password inside a proxy URL. See 407 Proxy Authentication Required. |
| 429 Too Many Requests (MDN) | Target | You sent too many requests in a given amount of time. | Slow down, honor Retry-After, spread requests over rotating proxies; see 429 Too Many Requests. |
| 451 Unavailable for Legal Reasons (MDN) | Target | Access is denied because of a legal demand. | Read the explanation and respect it; see 451. |
| 502 Bad Gateway (MDN) | Proxy or gateway | A gateway or proxy got an invalid response from the server behind it. | Retry a few times; if it repeats, test the proxy and the URL separately (502 and 504). |
| 503 Service Unavailable (MDN) | Either | The server is temporarily overloaded or down for maintenance. | Wait, honor Retry-After, retry more slowly (503). |
| 504 Gateway Timeout (MDN) | Proxy or gateway | A gateway or proxy got no timely response from the server behind it. | Raise your read timeout, retry, and check the target without the proxy. |
The standards behind the table: RFC 9110 (401 §15.5.2, 403 §15.5.4, 404 §15.5.5, 407 §15.5.8, 502 §15.6.3, 503 §15.6.4, 504 §15.6.5), RFC 6585 (429) and RFC 7725 (451).
Which codes to retry
Retry what is temporary, with growing pauses; never loop on a refusal.
| Code | Retry? |
|---|---|
| 429, 503 | Yes, after the Retry-After time if the response gives one, otherwise with exponential back-off |
| 502, 504, connection timeouts | Yes, up to 3 times, then test the proxy and the URL separately |
| 403, 451 | No: change the request (headers, IP type, pace) or stop |
| 401, 407 | No: fix the credentials first; a retry sends the same wrong login |
In Python, requests with urllib3's Retry does this for you:
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
retry = Retry(total=3, backoff_factor=1, status_forcelist=[429, 502, 503, 504],
allowed_methods=["GET", "HEAD"], respect_retry_after_header=True)
session = requests.Session()
session.mount("http://", HTTPAdapter(max_retries=retry))
session.mount("https://", HTTPAdapter(max_retries=retry))When the retries run out, requests raises RetryError with a message such as Max retries exceeded with url: / (Caused by ResponseError('too many 429 error responses')).
Python requests proxy errors: ProxyError, ConnectTimeout, ReadTimeout
Requests wraps urllib3, so a traceback names a requests exception and, inside it, the urllib3 cause. The urllib3 docs define them in one line each: ProxyError is "Raised when the connection to a proxy fails", ConnectTimeoutError "when a socket timeout occurs while connecting to a server", ReadTimeoutError "while receiving data from a server" (urllib3 exceptions; Requests API: exceptions).
| Exception | What you see in the message | Cause | First fix |
|---|---|---|---|
requests. | Max retries exceeded with url … Caused by ProxyError('Unable to connect to proxy', …) or OSError('Tunnel connection failed: 407 Proxy Authentication Required') | The proxy refused the tunnel (407, or a 5xx to CONNECT), or could not be reached at all; in urllib3 2.x a refused or timed-out connection to the proxy also arrives as ProxyError, with the real cause in the parentheses | Check gate.proxyfield.io:7000 with the username and password, or, with the allowlist, your IP on it and the port you set up in the dashboard; run the cURL test |
requests. | ConnectTimeoutError(…, 'Connection to … timed out. ( | No TCP connection within the connect timeout (the first number in timeout=(5, 30)): a firewall, a wrong port or a network block | Allow outbound traffic to port 7000; Requests documents these requests as safe to retry |
requests. | Read timed out. ( | Connected, but no data within the read timeout: a slow or heavy target, or a proxy still waiting for it | Raise the second timeout number, retry, target a location closer to the site |
requests. | NewConnectionError(…, '[Errno 111] Connection refused') or NameResolutionError(… "Failed to resolve …") | The parent class: a refused connection, a host name that does not resolve, a reset | Check the host spelling and port; see proxy connection refused |
requests. | Please check proxy URL. It is malformed and could be missing the host. | The proxy URL does not parse, often because the password holds @, : or / | URL-encode the password with urllib. |
requests. | [SSL: WRONG_ | TLS failed, often because the proxy URL starts with https:// for a proxy that speaks plain HTTP on that port | Use http:// as the proxy scheme; HTTPS sites still go through the encrypted tunnel |
requests. | Missing dependencies for SOCKS support. | A socks5:// proxy URL without the SOCKS extra installed | pip install "requests[socks]"; use socks5h:// to resolve DNS through the proxy |
| HTTP 407 as a response, not an exception | r.status_code == 407 | An http:// target and a wrong login: the proxy answered the request itself | Same fix as 407 above |
One script that shows which side each failure points to:
import requests
PROXY = "http://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000"
proxies = {"http": PROXY, "https": PROXY}
try:
r = requests.get("https://api.ipify.org", proxies=proxies, timeout=(5, 30))
r.raise_for_status()
print("exit IP:", r.text)
except requests.exceptions.ProxyError as e:
print("proxy side: host, port, login or tunnel ->", e)
except requests.exceptions.ConnectTimeout as e:
print("no connection within 5 s: firewall or port ->", e)
except requests.exceptions.ReadTimeout as e:
print("connected, no data within 30 s: slow target ->", e)
except requests.exceptions.SSLError as e:
print("TLS failed: check the proxy scheme ->", e)
except requests.exceptions.HTTPError as e:
print("the site or proxy answered", e.response.status_code)Then run the same credentials through cURL: if curl -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org works and Python fails, the problem is in the script (scheme, encoding, environment variables such as HTTPS_PROXY).
Connection failures
A connection failure happens before any status code: the client never reaches the proxy, or the proxy never reaches the site.
| Symptom | Likely cause | First fix |
|---|---|---|
Proxy connection refused, curl: (7) Failed to connect, or it keeps dropping | Wrong host or port, or a firewall | Check gate.proxyfield.io:7000, then run the checker; see proxy connection refused. |
| Cannot establish proxy connection | A VPN or proxy app cannot reach its server | Close other VPN and proxy apps; reconnect (cannot establish proxy connection). |
Unknown proxy server, curl: (5) Could not resolve proxy | The proxy host name does not resolve | Check the host spelling; try another DNS resolver (unknown proxy server). |
| Chrome: "Checking the proxy and the firewall" | Chrome cannot connect through its configured proxy | Check the system proxy settings and proxy extensions (checking the proxy and the firewall, Chrome proxy settings). |
curl: (28) timed out | No answer within the time limit | Raise the timeout once; if it repeats, test another location. |
Cloudflare errors when scraping
A Cloudflare error page means your request went through the proxy and reached Cloudflare, the site's gateway: the site's rules or its origin server answered, not your proxy. The page and the headers say so (Server: cloudflare, CF-RAY). If Cloudflare gets a normal 404 from the site, it passes the 404 on; it writes its own 52x page only when the origin fails. For scrapers, start with Cloudflare 403 Forbidden; all codes are in Cloudflare error codes.
| Code | What it means | First fix |
|---|---|---|
| 403 | A Cloudflare rule, a failed challenge or the origin refused the request | Find which rule fired: Cloudflare 403 Forbidden |
| 1005 | The site owner banned the network (ASN) your IP belongs to | Test from a residential IP |
| 1009 | The site owner banned your country or region | Use a location the site serves |
| 1010 | The site banned your browser's signature | Send consistent browser headers, or use a real browser |
| 1015 | A rate limiting rule fired | Slow down; retrying soon can extend the block |
| 1020 | A firewall rule on the site blocks the request | Change one thing at a time; see Cloudflare access denied |
| 502 | A bad gateway behind Cloudflare | Retry later; your request already reached Cloudflare |
| 520 | The origin sent an empty or unexpected response | Retry later; only the site owner can fix the origin |
| 521 | The origin refused Cloudflare's connection | Retry later |
| 522, 523 | Cloudflare's connection to the origin timed out (522), or the origin is unreachable (523) | Retry later; your proxy is not the cause |
| 524 | The origin connected but did not answer in time | Retry later, or request a lighter page |
"Proxy detected" and "anonymous proxy detected" messages
"Proxy detected" means the site, or an IP database it checks, classifies your IP as a proxy, VPN or datacenter address. IP databases label addresses by who holds them: datacenter ranges are usually listed as hosting; residential, mobile and static residential (ISP) IPs under the internet provider or carrier. An IP lookup tool shows how your exit IP is listed; more in anonymous proxy detected.
If a site rejects datacenter ranges, move to residential proxies or static residential (ISP) proxies; where datacenter ranges are accepted, datacenter proxies are usually enough. No IP type is a guarantee: sites also check headers, fingerprints and request rates.
Slow proxies, sticky IPs that change, scrapers that fail on a server
- Slow responses. A distant exit location or a slow target adds time; target a location closer to the site and compare response times in the checker. On ProxyField, "If a node slows down, traffic automatically moves to the next one." More in slow proxies and changing IPs.
- A sticky IP that changes. Sticky sessions last from 30 s to 36 h (presets 1, 5, 10, 30 min, 1, 3, 6 h). Set a session longer than the task; when it ends, expect a new IP. The IP is not guaranteed if the exit node drops; on a connection error the gateway retries once with a new session, so the IP may change, and a connection that breaks is not restored, so your client reconnects.
- Works on your laptop, fails on a server. Add the server's IP to the allowlist, or switch to username and password, and check that its firewall allows outbound connections to port 7000, or the port you set up in the dashboard for the allowlist.
- A Playwright or Puppeteer timeout. Run the cURL check first, then block images, fonts and media and raise the navigation timeout; see the Playwright proxy setup.
ProxyField gateway errors
What the ProxyField gateway returns when the problem is on your side:
| Situation | What you see | First fix |
|---|---|---|
| Wrong username or password | 407 Proxy Authentication Required | Copy the credentials again from your account. |
| Your IP is not on the allowlist | 407 Proxy Authentication Required | Add your current IP, or use username and password (proxy authentication). |
| No traffic left | 402 Payment Required (ProxyField: no traffic left. Top up at https://) | Top up. Traffic never expires, and all purchases are final. |
| Unsupported or misspelled location | 407 Proxy Authentication Required when the location is malformed, or 502 Bad Gateway when it is well formed but no exit could be connected | Check the parameter against the targeting docs. |
For anything else, our 24/7 live chat helps, including with setup and integration.
Still failing? Test and contact support
- Run the proxy through the proxy checker again.
- Request
https://api.ipify.orgthrough the proxy and confirm the IP you get back is the proxy's exit IP, not your own. - Re-check the gateway, port and credentials against your account.
- Contact our 24/7 live chat with the time, target URL, full error and exit IP.
A proxy that won't work at all has its own checklist: why is my proxy not working.
Proxy Errors and Status Codes FAQ
What is a proxy error, and how do I fix the most common ones when scraping?
ProxyField proxies run at a 99.6% success rate, according to our service data; a proxy error is a request that fails anyway, from the proxy (407, 502, 504, a refused connection) or from the target site (403, 429, Cloudflare 10xx). Fix 407 with the right credentials or allowlist and a URL-encoded password, 403 with browser-like headers or another IP type, 429 by slowing down and honoring Retry-After, and 502 or 504 with a longer timeout and up to 3 retries with back-off.
What are the common proxy errors in Python requests, like ProxyError and ConnectTimeout, and what causes each one?
ProxyError means the proxy could not be used: wrong host or port, a refused tunnel such as Tunnel connection failed: 407 Proxy Authentication Required, or a proxy that is unreachable. ConnectTimeout means no connection within the first number of timeout=(5, 30), and ReadTimeout means connected but no data within the second. InvalidProxyURL points to an unencoded @ or : in the password, and SSLError with WRONG_VERSION_NUMBER to an https:// proxy scheme where http:// is needed.
What do proxy error codes mean, and how do they differ from the HTTP status codes a website returns?
The proxy passes the website's own codes, such as 403, 404 or 429, through unchanged. It answers with its own code only when it cannot complete the request: 407 for a missing login, 502 or 504 when the server behind it fails or is too slow, or a provider's own number such as Cloudflare's 52x. A connection failure has no code at all; curl -i shows which header block, the proxy's or the site's, carries the code.
What do proxy error codes mean?
A 4xx code means a request was refused, by the proxy (407) or the site (401, 403, 429, 451). A 5xx code means a server failed or timed out: the proxy, a gateway such as Cloudflare, or the server behind it (502, 503, 504).
What does each HTTP status code mean for scrapers?
401: the site wants its own login. 403: the site blocked you. 404: the page does not exist. 407: the proxy needs a login. 429: a rate limit. 451: a legal block. 502 and 504: a gateway failed or timed out. 503: the server is overloaded or in maintenance.
What are common web scraping errors and how do I fix them?
Blocks (403, Cloudflare 1020), rate limits (429), proxy authentication (407) and timeouts (504, ReadTimeout). Fix blocks with browser-like headers or another IP type, rate limits by slowing down, 407 by checking credentials, and timeouts by retrying with a longer timeout.
How do I prevent proxy errors?
Test the proxy alone before a run, keep the credentials and allowlist up to date, set connect and read timeouts, and retry only 429, 502, 503 and 504 with back-off. Pace requests within each site's rules, and use a sticky session where a site ties a session to one IP.
What happens if a proxy fails or goes offline?
On ProxyField, "If a node slows down, traffic automatically moves to the next one." On per-request rotation, the next request simply gets a new IP, so retry the failed one.
Do rotating proxies reduce timeouts?
They help when a timeout comes from one slow exit IP, because the retry leaves through another. They don't help when the target itself is slow or down; raise the timeout or try later.
Why do proxies time out on some sites but not others?
A slow or distant target, heavy pages, or a site that delays suspicious traffic all add time. Target a location closer to the site, block heavy resources in browsers, and compare response times in the proxy checker.
Show 3 more questionsShow fewer questions
How do I fix a Playwright timeout through a proxy?
A page.goto timeout through a proxy usually means slow, heavy pages or wrong credentials on an HTTPS site. Run the cURL check first, then block images, fonts and media and raise the timeout; the Playwright proxy setup troubleshooting table covers each case.
Why might the error appear in one application but not another?
Each app may use its own proxy setting, ignore the system proxy, read HTTP_PROXY and HTTPS_PROXY variables, cache old credentials or use another protocol. Compare the host, port, scheme and username the two apps send, and test both against https://api.ipify.org.
Are free proxies more likely to cause errors than paid proxies?
Usually, yes: free public proxies are shared by many users, go offline without notice and are often already blocked, so timeouts and 403s are common. A paid gateway with rotation and failover avoids most of that.
Error guides
- Cloudflare error codes
- Cloudflare 403 Forbidden
- 429Too Many Requests
- 407Proxy Authentication
- Proxy detected
- Cannot establish connection
- Checking the proxy and firewall
- Proxy not working
- 503Service Unavailable
- 451Legal Reasons
- Unknown proxy server
- 502 and 504 gateway errors
- Cloudflare 10xx errors
- Connection refused
- 403Forbidden
- Slow proxies, changing IPs