Scrapeless Wiki

Why Is My Proxy Not Working?

Troubleshooting P1 why is my proxy not working

Diagnose a proxy that will not connect, authenticate, or route traffic. Covers credentials, ports, protocol mismatches, exhausted pools, and silent bypasses.

"The proxy isn't working" covers at least five unrelated failures, and each has a different fix. The first job is not to fix anything β€” it is to determine whether the proxy is refusing you, failing to connect, working but blocked at the destination, or quietly not being used at all.

1. First, Establish Which Failure You Have

Run this before changing anything:

curl -x http://user:pass@proxy-host:port https://httpbin.org/ip

The outcome tells you where you are:

Result Meaning
Returns the proxy's IP The proxy works β€” your problem is elsewhere
Returns your own IP Traffic is bypassing the proxy entirely
407 Proxy Authentication Required Credentials wrong, missing, or wrong scheme
Connection refused Wrong host or port, or the proxy is down
Hangs, then times out Firewall, wrong protocol, or an unreachable exit node
503 / pool error from the provider Out of credit, no matching exit node, or plan limits

That last distinction β€” the proxy working but the destination blocking you β€” is the one most often misdiagnosed, and no proxy configuration change will fix it.

2. Common Causes

Silent bypass. The most under-diagnosed failure. Setting HTTP_PROXY does nothing for HTTPS unless HTTPS_PROXY is also set, and many libraries ignore environment variables entirely unless told to trust them. Everything appears to work while your real address is exposed.

Wrong protocol scheme. http:// versus socks5:// versus socks5h://. With socks5 the client resolves DNS locally and leaks it; socks5h resolves at the proxy. Using the wrong one produces either a leak or a resolution failure.

Credentials in the wrong place. Some providers expect credentials in the URL, others in a Proxy-Authorization header, others authenticate by IP allowlist β€” in which case a username and password is not just unnecessary but rejected.

IP allowlist not updated. Authentication by source IP fails the moment your egress address changes, which happens on redeploys, autoscaling, and moving between networks.

Exhausted quota. Bandwidth or request limits reached. Providers often signal this with an error the client library surfaces as a generic connection failure.

Wrong port for the intended pool. Many providers encode pool, region, and session behaviour into the port number. Port 8000 and port 9000 may be datacenter and residential respectively.

Session syntax wrong. Sticky sessions are usually requested through the username (user-session-abc123). A malformed session token silently reverts to rotating, so your session-dependent flow breaks in a way that looks random.

Certificate errors through the proxy. An intercepting proxy presents its own certificate. Disabling verification hides the problem and creates a worse one.

3. How to Diagnose It

Verify the exit IP explicitly. Never assume traffic is proxied β€” check what the destination sees. This single test catches the silent bypass class immediately.

Test the proxy independently of your code. curl -x removes your application from the equation. If curl works and your code does not, the bug is in your client configuration.

Try HTTP and HTTPS separately. They are configured independently in most tooling, and one working does not imply the other.

Check the provider's dashboard. Quota, active sessions, and per-request error codes are usually visible there, and it will tell you about exhausted credit far faster than any local test.

Test with and without authentication to distinguish "credentials rejected" from "credentials not required".

Increase timeouts temporarily. Residential exit nodes are genuinely slow β€” a request that fails at 5 seconds and succeeds at 30 is a timeout problem, not a proxy problem.

4. How to Fix It

  • Set both HTTP_PROXY and HTTPS_PROXY, or better, configure the proxy explicitly in your client rather than relying on environment variables.
  • Use socks5h:// when routing SOCKS traffic, so DNS resolves at the proxy and does not leak.
  • Move credentials to the form your provider documents, and re-read that documentation rather than assuming the common form.
  • Re-add your current egress IP to the allowlist after any deployment or network change.
  • Raise timeouts for residential pools; datacenter latency expectations do not transfer.
  • Verify the exit IP in a startup check so a silent bypass fails loudly at boot instead of quietly for hours.
  • Never disable TLS verification to make a certificate error disappear β€” that converts a visible misconfiguration into an invisible security hole.

5. When the Proxy Is Fine and the Target Still Blocks You

If httpbin.org/ip returns the proxy's address, the proxy is working and the problem has moved downstream. Blocking at that point comes from IP reputation, TLS fingerprint, header composition, or request rate β€” none of which a proxy change addresses. A datacenter address may be refused on ASN alone regardless of how correctly it is configured.

6. Real-World Examples

  • Everything works, but the target still sees the real IP. HTTPS_PROXY was never set.
  • Works locally, 407 in production. Authentication is by IP allowlist and the production egress address was never added.
  • Sticky sessions behaving randomly. A malformed session token silently fell back to rotation.
  • Intermittent timeouts on residential. Exit nodes going offline mid-request β€” expected behaviour, handled with retries rather than reconfiguration.
  • Sudden total failure mid-month. Bandwidth quota exhausted; the client reported it as a connection error.

7. Summary

Start by finding out what the destination actually sees. That single check splits "not proxied at all" from "proxied but refused" from "proxied and working", and those three have nothing in common.

Most real failures are configuration rather than infrastructure: HTTPS_PROXY unset, the wrong scheme, credentials in the wrong place, or an IP allowlist that stopped matching after a deploy. And once you confirm the exit IP is the proxy's, stop adjusting the proxy β€” the problem has moved to how the request looks, not where it comes from.