# Proxy HTTP & CGNAT Error Codes Reference (407, 403, 429, 1015, 1020) | PrivateByte

- **Canonical URL:** https://privatebyte.com/glossary/proxy-http-errors
- **Updated:** 2026-12-04

Developer troubleshooting guide for HTTP 407, 403, 429, Cloudflare 1015/1020, 502/504, 503, RFC 6598 Double NAT / CGNAT, and SOCKS5h DNS leaks with curl diagnostics and RFC citations.

## HTTP 407: 407 Proxy Authentication Required (Proxy Auth · RFC 9110)

**Cause:** The proxy gateway rejected your request because credentials are missing, URL-encoded incorrectly, or your source IP is not on the allowlist.

**Fix:** Pass credentials explicitly with curl -U user:pass (or percent-encode special characters like @ or : inside proxy URLs). On PrivateByte CleanProxy, verify your active proxy username/password or IP allowlist in the dashboard and confirm wallet credit is non-zero.

```bash
curl -x http://USER:PASS@proxy.privatebyte.com:8080 -I https://api.ipify.org
```

Links: [CleanProxy Auth & Setup](https://privatebyte.com/proxies) | [Free Proxy Checker](https://privatebyte.com/tools/proxy-checker)

## HTTP 403: 403 Forbidden (Datacenter ASN or TLS Fingerprint Block) (Anti-Bot / ASN Reputation)

**Cause:** The origin server or WAF accepted the TCP connection but blocked access because the IP sits on a flagged datacenter ASN, has poor abuse reputation, or failed TLS JA3/JA4 inspection.

**Fix:** Check how websites classify your current IP at /tools/ip-check. If the target blocks hosting ASNs, switch from datacenter IPs to static ISP or rotating residential proxies, and match browser TLS/HTTP2 headers rather than default Python requests headers.

```bash
curl -s https://privatebyte.com/tools/ip-check && curl --proxy socks5h://USER:PASS@HOST:PORT https://httpbin.org/headers
```

Links: [Datacenter vs ISP IP Check](https://privatebyte.com/tools/ip-check) | [Rotating Residential Proxies](https://privatebyte.com/residential-proxies)

## HTTP 429: 429 Too Many Requests (Rate Limiting · RFC 6585)

**Cause:** Too many concurrent or sequential requests hit the target from a single exit IP within its sliding rate-limit window.

**Fix:** Respect Retry-After response headers, add jittered exponential backoff, and switch from a sticky session to per-request IP rotation on rotating residential or clean datacenter pools so request volume spreads across distinct ASNs.

```bash
curl -i --proxy http://USER:PASS@HOST:PORT https://example.com | grep -iE 'HTTP/|retry-after|x-ratelimit'
```

Links: [Rotating vs Sticky Guide](https://privatebyte.com/rotating-vs-sticky-proxies) | [Non-Expiring CleanProxy](https://privatebyte.com/proxies)

## CF 1015 / 1020: Cloudflare Error 1015 (Rate Limited) & Error 1020 (Access Denied) (WAF Rate Limit & Firewall)

**Cause:** Error 1015 triggers when a single IP breaches a site's Cloudflare rate-limiting rule; Error 1020 triggers when a custom WAF rule blocks your ASN, country, or missing browser headers.

**Fix:** Verify geo-targeting matches the site's allowed country list, inspect IP reputation with our Blacklist Checker, and rotate to a clean residential or ISP ASN instead of retrying from the same flagged datacenter subnet.

```bash
curl -s -o /dev/null -w '%{http_code} %{remote_ip}\n' --proxy socks5h://USER:PASS@HOST:PORT https://target.example
```

Links: [Fix CF 1015/1020 Guide](https://privatebyte.com/blog/fix-cloudflare-error-1015-1020-scraping) | [IP Blacklist Checker](https://privatebyte.com/tools/ip-blacklist-checker)

## HTTP 502 / 504: 502 Bad Gateway & 504 Gateway Timeout (Gateway / Upstream Timeout)

**Cause:** The proxy node could not establish a healthy TCP/TLS handshake to the target host within the timeout window, or a residential peer disconnected mid-flight.

**Fix:** Confirm the target is reachable directly, increase client connect/read timeouts slightly for distant geos, and retry on a fresh session ID. For latency-sensitive APIs, pick a regional POP closest to the origin via our 55-endpoint RTT directory.

```bash
curl -m 15 -w 'connect=%{time_connect}s ttfb=%{time_starttransfer}s code=%{http_code}\n' -o /dev/null -s https://target.example
```

Links: [55-Endpoint Live 3-POP RTT](https://privatebyte.com/tools/latency) | [Static ISP Proxies](https://privatebyte.com/isp-proxies)

## HTTP 503: 503 Service Unavailable (Anti-Bot Challenge or Origin Saturation) (Challenge Interstitial / Overload)

**Cause:** Either the target origin is overloaded or an edge WAF is serving a 503 JavaScript challenge page to non-browser HTTP clients.

**Fix:** Inspect the response body to distinguish true server downtime from a WAF challenge interstitial. If it is an anti-bot challenge, route headless browser requests (Playwright/Puppeteer) through a clean residential or ISP proxy with consistent cookies and timezone.

```bash
curl -s -D - https://target.example | head -n 30
```

Links: [Browser Automation Proxies](https://privatebyte.com/antidetect-browser-proxies) | [Residential Proxy Q&A](https://privatebyte.com/glossary/residential-proxies)

## CGNAT / Double NAT: Strict NAT / Double NAT / Blocked Inbound Port Forwarding (RFC 6598 · 100.64.0.0/10)

**Cause:** Your residential ISP (Starlink, T-Mobile 5G Home Internet, fiber DS-Lite) assigns a shared RFC 6598 CGNAT address (100.64.0.0/10), silently dropping all inbound TCP and UDP connections before they reach your router.

**Fix:** Confirm CGNAT in 2 seconds with our CGNAT Checker, then route an outbound WireGuard tunnel to a $3/mo PrivateByte Static IPv4 Gateway so Plex, Home Assistant, and UDP game servers receive direct public traffic.

```bash
curl -s https://api.ipify.org && echo ' (compare against router WAN IP; 100.64.0.0/10 = CGNAT)'
```

Links: [Free CGNAT Checker](https://privatebyte.com/tools/cgnat-checker) | [WireGuard Static IP ($3/mo)](https://privatebyte.com/gateway)

## SOCKS5 DNS Leak: DNS Leak When Using socks5:// Instead of socks5h:// (RFC 1928 · Local vs Remote DNS)

**Cause:** Using socks5:// in curl or HTTP libraries resolves target hostnames via your local ISP DNS before tunneling the TCP connection, leaking the requested domain and causing geo-CDN mismatches.

**Fix:** Always use socks5h:// (the 'h' resolves hostnames remotely through the proxy exit node) so DNS queries match the proxy's geographic location and never leak to local resolvers.

```bash
curl --proxy socks5h://USER:PASS@HOST:PORT https://ipleak.net/json/
```

Links: [SOCKS5h vs SOCKS5 Guide](https://privatebyte.com/blog/curl-socks5h-vs-socks5-prevent-dns-leak) | [SOCKS5 Proxy Pools](https://privatebyte.com/socks5-proxies)

## Sources & Primary Citations

- [RFC 9110: HTTP Semantics (403, 407, 502, 503, 504)](https://datatracker.ietf.org/doc/html/rfc9110): Authoritative IETF definitions for HTTP proxy and gateway status codes.
- [RFC 6585: Additional HTTP Status Codes (429 Too Many Requests)](https://datatracker.ietf.org/doc/html/rfc6585): IETF specification for 429 rate-limiting and Retry-After semantics.
- [RFC 1928: SOCKS Protocol Version 5](https://datatracker.ietf.org/doc/html/rfc1928): IETF SOCKS5 specification covering remote vs local hostname resolution.
- [RFC 6598: Carrier-Grade NAT (100.64.0.0/10)](https://datatracker.ietf.org/doc/html/rfc6598): IETF specification for ISP CGNAT shared address space.
- [Cloudflare 1xxx Troubleshooting Documentation](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/): Official reference for Cloudflare Error 1015 and Error 1020.
- [curl Manual: --proxy and socks5h://](https://curl.se/docs/manpage.html): Official curl documentation distinguishing socks5:// from socks5h://.
