Proxy timeout errors happen when one stage of a request takes longer than your client is willing to wait. The fix depends on which stage it was: connecting to the proxy, the proxy opening a tunnel to the website, or the website sending its response. Most clients lump all of these into one generic "timed out" message, so the first step is to measure them separately.
The Three Timeouts in a Proxied Request
- Connect to the proxy. Your client opens a TCP connection to global.nodeproxies.xyz:8080. This should take well under a second. If it times out, the problem is your network, a firewall, or a wrong host or port.
- Tunnel setup. For HTTPS, your client sends CONNECT and waits for "200 Connection established". The proxy has to pick an exit and reach the target through it. Residential and mobile exits add time here.
- Response. After the tunnel is up, the TLS handshake happens and the website sends its response. A slow site, a large page or a congested exit shows up here as a read timeout.
A 504 Gateway Timeout is a related but different thing: it's a status code sent by a gateway (the proxy or a CDN) saying it waited for the next hop and gave up. Your client didn't time out; something upstream did.
Measure Each Stage with curl
curl's --write-out variables show exactly where time goes:
curl -s -o /dev/null \
-x http://USERNAME:[email protected]:8080 \
--connect-timeout 10 --max-time 60 \
-w "connect to proxy: %{time_connect}s\ntunnel ready: %{time_appconnect}s\nfirst byte: %{time_starttransfer}s\ntotal: %{time_total}s\nstatus: %{http_code}\n" \
https://example.comtime_connect is the TCP connection to the proxy. time_appconnect is when the TLS handshake with the website finished, which includes the CONNECT tunnel setup. time_starttransfer is when the first byte of the response arrived. Run it five or ten times: with rotating proxies each run uses a different exit, so you'll see the spread, not just one sample.
- High time_connect: network path to the proxy. Check your own connection, VPN or firewall.
- High gap between time_connect and time_appconnect: tunnel setup or a slow exit. Retry with a new IP, or target a country closer to the website.
- High gap between time_appconnect and time_starttransfer: the website is slow to generate the page.
- High gap between time_starttransfer and time_total: a large response or a slow exit link.
Set Separate Connect and Read Timeouts
A single overall timeout is either too short for slow pages or too long for dead connections. Set them separately. In Python requests, pass a tuple:
import requests
PROXY = "http://USERNAME:[email protected]:8080"
proxies = {"http": PROXY, "https": PROXY}
try:
# (connect timeout, read timeout) in seconds
r = requests.get("https://example.com", proxies=proxies, timeout=(10, 30))
print(r.status_code)
except requests.exceptions.ConnectTimeout:
print("Could not connect to the proxy or open the tunnel in 10s")
except requests.exceptions.ReadTimeout:
print("Connected, but the response stalled for more than 30s")Note that requests' read timeout is the maximum gap between bytes, not the total download time. A page that trickles in slowly can take longer than 30 seconds overall without raising ReadTimeout. If you need a hard ceiling, enforce it in your own code or use a client with a total timeout, such as aiohttp's ClientTimeout(total=...).
Sensible Timeout Values by Proxy Type
- Datacenter proxies: fast and consistent. A 5-10 second connect timeout and 20-30 second read timeout are usually plenty.
- Residential proxies: exits are real home connections with variable speed. Allow 10-15 seconds to connect and 30-60 seconds to read.
- Mobile proxies: carrier networks add latency. Use similar or slightly longer values than residential.
Too-short timeouts are a common cause of "proxy timeout" reports. If 10% of requests time out at 10 seconds but nearly all succeed at 30, the proxy is fine and the timeout is too aggressive.
Other Causes of Timeouts
A sticky session stuck on a slow exit
With USERNAME-session-abc123-time-30, every request reuses the same exit for 30 minutes. If that exit becomes slow, every request is slow. On timeout, switch to a new session id to get a new IP.
Exits far from the target
Without country targeting, an exit may be on another continent from the website. If the target is US-hosted, adding -country-us to the username often cuts latency. See why proxy speed is slow for more speed fixes.
Your own machine is the bottleneck
Hundreds of concurrent requests from one laptop can saturate your uplink, CPU or open file limit, and the symptom is timeouts that look like proxy problems. Lower concurrency and see whether the timeout rate drops.
The site is throttling you
Some sites slow responses instead of returning 429. If response time climbs steadily during a run, you're being throttled. Slow down; see 429 Too Many Requests with proxies.
Retry Timeouts the Right Way
Timeouts on rotating proxies are usually transient, so retry once or twice with a fresh IP and a short backoff. Only retry idempotent requests such as GET; retrying a POST that timed out on read might submit it twice.
Avoiding Timeouts with NodeProxies
Use country targeting to keep exits near your target, rotate per request by default, and set connect and read timeouts separately. If speed matters more than IP type, compare residential and datacenter on your actual target with a small plan; plans start at 100 MB. Rates are on the pricing page.
FAQ
What is a good timeout for residential proxies?
Around 10-15 seconds to connect and 30-60 seconds to read is a good starting point. Tune it from your own measurements.
Why does my proxy time out but work in the browser?
Browsers wait much longer than most HTTP libraries by default. Your code may have a short timeout, or it may be using a different host, port or protocol from the browser.
What does 504 Gateway Timeout mean with a proxy?
A gateway in the chain waited for the next server and gave up. It's usually transient; retry with a new IP and check whether the target is slow.
Do timeouts use bandwidth?
Only the bytes actually transferred count. A request that times out before receiving data uses almost nothing; one that times out halfway through a large download uses what arrived.
