Docs menu
Docs · Errors and fixes

Proxy Errors and Status Codes: What Each Means

A proxy error is a request that fails somewhere between your client, the proxy and the website: either the proxy itself refuses or fails (407, 502, 504, a refused connection), or the website answers through it (403, 404, 429, Cloudflare 1020). A proxy passes the site's own status codes through unchanged and sends its own code only when it cannot complete the request. In Python requests, ProxyError means the proxy could not be used (often Tunnel connection failed: 407 Proxy Authentication Required), ConnectTimeout means no connection in time and ReadTimeout means connected but no data in time. The ProxyField gateway, gate.proxyfield.io:7000, runs at a 99.6% success rate, according to our service data; test it on your own targets with the Easy Trial: 1 GB for $2.95.

residential IPs
412M+
from, traffic never expires
$1.95/GB
Easy Trial
1 GB for $2.95
gate.proxyfield.io:7000
407, 402, 502 and SOCKS5 0x04 on ProxyField
407, 402, 502 and 0x04 on ProxyFieldProxyField value
407 Proxy Authentication Requireda wrong login or password, an IP not on the allowlist, or a malformed location in the username; text: "ProxyField: wrong login or password, or this IP is not in the whitelist."; it carries Proxy-Authenticate: Basic, on CONNECT too
402 Payment Requiredno traffic left; text: "ProxyField: no traffic left. Top up at https://proxyfield.io"
502 Bad Gatewaythe location is well formed, but no exit could be connected (no fallback to a nearby city); text: "ProxyField: temporary error. Try again in a few seconds."
SOCKS5a failed login or no traffic left is an authentication failure; a failed exit is reply 0x04
A 403from the site itself, passed through
Traffic runs out mid-connectionthe connection closes
Costa connection the gateway refuses (407, 402, 502) costs nothing
Gatewaygate.proxyfield.io:7000 with your username and password; HTTP, HTTPS and SOCKS5 on the same host and port
Username<login>-country-us-city-new_york: names in lowercase with underscores for spaces, the country as its two-letter code
Allowlistup to 100 IPv4 addresses; with the allowlist, use the port you set up in the dashboard

What to change

  1. 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.
  2. 402: top up in your account; your traffic never expires, and a new purchase adds to the remaining balance.
  3. 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.
  4. SOCKS5: an authentication failure is fixed like a 407 or a 402; reply 0x04 like a 502.
  5. A 403 comes 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:

Shell
curl -v -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org

What 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.

  1. Test the proxy alone. Use the proxy checker, or send one request with the credentials from your account:

    Shell
    curl -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org

    An IP address back means the proxy works.

  2. 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.

  3. 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.

  4. 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:

Shell
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 seeWho sent it
The first block, the answer to CONNECT: 200 (tunnel open, wording varies) or 407The 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 pageCloudflare, 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.

CodeSent byWhat it means for a scraperFirst fix
401 Unauthorized (MDN)TargetThe 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)TargetThe site refuses the request: headers, IP reputation or a firewall rule.Match a real browser's headers; see 403 Forbidden.
404 Not Found (MDN)TargetThe 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)ProxyThe 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)TargetYou 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)TargetAccess is denied because of a legal demand.Read the explanation and respect it; see 451.
502 Bad Gateway (MDN)Proxy or gatewayA 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)EitherThe server is temporarily overloaded or down for maintenance.Wait, honor Retry-After, retry more slowly (503).
504 Gateway Timeout (MDN)Proxy or gatewayA 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.

CodeRetry?
429, 503Yes, after the Retry-After time if the response gives one, otherwise with exponential back-off
502, 504, connection timeoutsYes, up to 3 times, then test the proxy and the URL separately
403, 451No: change the request (headers, IP type, pace) or stop
401, 407No: fix the credentials first; a retry sends the same wrong login

In Python, requests with urllib3's Retry does this for you:

Python
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).

ExceptionWhat you see in the messageCauseFirst fix
requests.exceptions.ProxyErrorMax 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 parenthesesCheck 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.exceptions.ConnectTimeoutConnectTimeoutError(…, 'Connection to … timed out. (connect timeout=5)')No TCP connection within the connect timeout (the first number in timeout=(5, 30)): a firewall, a wrong port or a network blockAllow outbound traffic to port 7000; Requests documents these requests as safe to retry
requests.exceptions.ReadTimeoutRead timed out. (read timeout=30)Connected, but no data within the read timeout: a slow or heavy target, or a proxy still waiting for itRaise the second timeout number, retry, target a location closer to the site
requests.exceptions.ConnectionErrorNewConnectionError(…, '[Errno 111] Connection refused') or NameResolutionError(… "Failed to resolve …")The parent class: a refused connection, a host name that does not resolve, a resetCheck the host spelling and port; see proxy connection refused
requests.exceptions.InvalidProxyURLPlease 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.parse.quote(password, safe="")
requests.exceptions.SSLError[SSL: WRONG_VERSION_NUMBER] wrong version numberTLS failed, often because the proxy URL starts with https:// for a proxy that speaks plain HTTP on that portUse http:// as the proxy scheme; HTTPS sites still go through the encrypted tunnel
requests.exceptions.InvalidSchemaMissing dependencies for SOCKS support.A socks5:// proxy URL without the SOCKS extra installedpip install "requests[socks]"; use socks5h:// to resolve DNS through the proxy
HTTP 407 as a response, not an exceptionr.status_code == 407An http:// target and a wrong login: the proxy answered the request itselfSame fix as 407 above

One script that shows which side each failure points to:

Python
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.

SymptomLikely causeFirst fix
Proxy connection refused, curl: (7) Failed to connect, or it keeps droppingWrong host or port, or a firewallCheck gate.proxyfield.io:7000, then run the checker; see proxy connection refused.
Cannot establish proxy connectionA VPN or proxy app cannot reach its serverClose other VPN and proxy apps; reconnect (cannot establish proxy connection).
Unknown proxy server, curl: (5) Could not resolve proxyThe proxy host name does not resolveCheck the host spelling; try another DNS resolver (unknown proxy server).
Chrome: "Checking the proxy and the firewall"Chrome cannot connect through its configured proxyCheck the system proxy settings and proxy extensions (checking the proxy and the firewall, Chrome proxy settings).
curl: (28) timed outNo answer within the time limitRaise 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.

CodeWhat it meansFirst fix
403A Cloudflare rule, a failed challenge or the origin refused the requestFind which rule fired: Cloudflare 403 Forbidden
1005The site owner banned the network (ASN) your IP belongs toTest from a residential IP
1009The site owner banned your country or regionUse a location the site serves
1010The site banned your browser's signatureSend consistent browser headers, or use a real browser
1015A rate limiting rule firedSlow down; retrying soon can extend the block
1020A firewall rule on the site blocks the requestChange one thing at a time; see Cloudflare access denied
502A bad gateway behind CloudflareRetry later; your request already reached Cloudflare
520The origin sent an empty or unexpected responseRetry later; only the site owner can fix the origin
521The origin refused Cloudflare's connectionRetry later
522, 523Cloudflare's connection to the origin timed out (522), or the origin is unreachable (523)Retry later; your proxy is not the cause
524The origin connected but did not answer in timeRetry 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:

SituationWhat you seeFirst fix
Wrong username or password407 Proxy Authentication RequiredCopy the credentials again from your account.
Your IP is not on the allowlist407 Proxy Authentication RequiredAdd your current IP, or use username and password (proxy authentication).
No traffic left402 Payment Required (ProxyField: no traffic left. Top up at https://proxyfield.io)Top up. Traffic never expires, and all purchases are final.
Unsupported or misspelled location407 Proxy Authentication Required when the location is malformed, or 502 Bad Gateway when it is well formed but no exit could be connectedCheck 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

  1. Run the proxy through the proxy checker again.
  2. Request https://api.ipify.org through the proxy and confirm the IP you get back is the proxy's exit IP, not your own.
  3. Re-check the gateway, port and credentials against your account.
  4. 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

Easy Trial: 1 GB for $2.95.

Try for the price of 1 GB, no subscription, traffic never expires.