Python requests Timeout With a Proxy: Connect vs Read
Which timeout fired, what the exception name tells you, and how to pick values from your own measurements.
The three usual causes
First, no timeout at all. The Requests documentation says requests do not time out unless a value is set, so a stuck proxy or target can keep your code waiting for minutes or more.
Second, the proxy is not reachable: a wrong host or port, a closed port, a blocked outbound port or a proxy that is down. This is a connect-stage failure, but in our test it surfaced as ProxyError.
Third, the proxy answers but the target is slow, or your read value is lower than the slowest normal response. That is ReadTimeout. Work through them in this order.
Source: Proxy302 local test, 17 November 2026, requests 2.32.5 with urllib3 2.6.3, timeout=(2, 3); other versions may differ. ProxyError is a subclass of ConnectionError, and Timeout catches both ConnectTimeout and ReadTimeout.
The connect timeout is how long Requests waits to establish a connection; the documentation suggests a value slightly above a multiple of 3, the default TCP retransmission window. The read timeout is how long the client waits between bytes from the server, which in almost every case is the wait for the first byte.
One number, timeout=5, applies to both. A tuple such as timeout=(3.05, 27) sets them separately. Two details matter in practice. If a name resolves to several addresses, each is tried in turn, so the connect wait can be a multiple of what you set. And neither value is a wall-clock limit, so a response that keeps trickling in can run past both.
Send 20 or so requests to your real target through the proxy and print r.elapsed.total_seconds() for each. Elapsed is the time from sending the request until the response headers are parsed.
Expected result You have a normal range and a slowest normal response, for example 8 seconds.
Step 2: set read above the slowest normal response
A read value well above that number, for example about double (16 to 20 seconds for an 8 second worst case), stops healthy-but-slow pages from failing without letting a dead connection wait forever. This is a rule of thumb, not a Requests recommendation.
Step 3: set connect for the proxy
Connect decides how long you wait for an unreachable proxy before ProxyError. Start with a value you can live with on your network, for example 10 seconds, and lower it if failures should show up sooner.
Step 4: retry only what is safe to retry
ConnectTimeout is documented as safe to retry. For a read timeout on a POST, make sure repeating it cannot create the action twice. For retry and backoff, see the ProxyError retry guide.
import requests
from requests.exceptions import ConnectTimeout, ReadTimeout, ProxyError, RequestException
PROXY = "http://LOGIN:PASSWORD@HOST:PORT"
PROXIES = {"http": PROXY, "https": PROXY}
def fetch(url, connect=10, read=30):
try:
r = requests.get(url, proxies=PROXIES, timeout=(connect, read))
r.raise_for_status()
return r
except ProxyError as e:
print("proxy not reachable or refused:", e)
except ConnectTimeout:
print("connect timed out after", connect, "s")
except ReadTimeout:
print("connected, no data for", read, "s")
except RequestException as e:
print("other request error:", type(e).__name__)
if __name__ == "__main__":
fetch("https://ipinfo.io/json")
Example only. Replace the placeholder with your own proxy string. Run locally against a closed port, it printed the ProxyError branch.
Checks in order when it still fails
ProxyError at once, "Unable to connect to proxy"
Check Host, port and protocol in the proxy string. On Proxy302 the host is proxy.proxy302.com, HTTP is port 2222 and SOCKS5 is port 3333.
Fix Copy host, port, username and password from My assets. For SOCKS5 install requests[socks] and write socks5h:// so the proxy resolves names.
Stop when If the same string works in curl but not in Python, check HTTP_PROXY and HTTPS_PROXY in your environment next.
ProxyError after exactly your connect value
Check Whether your network or firewall allows outbound connections to that port.
Fix Try the same proxy from another network. See the ERR_PROXY_CONNECTION_FAILED checklist for the order of checks.
Stop when Several networks time out on the same proxy: open a ticket with the order number.
ReadTimeout only through the proxy
Check Open the same URL directly and through the proxy and compare r.elapsed.
Fix If the direct request is also slow, raise read for that target. If only the proxy path is slow, test a second country or another URL first.
Stop when Every URL fails through the proxy but works directly: stop tuning timeouts and contact support.
The script never ends
Check Is timeout passed on every call, including inside helper functions?
Fix Pass timeout everywhere, or wrap Session so a default is always added.
Using this with Proxy302
The same username and password work over HTTP on port 2222 and SOCKS5 on port 3333 of proxy.proxy302.com for rotating residential. A Session reuses connections, and on a rotating line each new connection gets a new IP, so the IP changes when a timeout forces a new connection.
The smallest purchase is 1 GB of rotating residential traffic, and there is no free trial, so test your timeout values on a small amount first. Prices are on the rotating residential page and the pricing page. For the basic setup see the requests proxy guide.
Split one curl request into connect and first-byte time to see if a slow proxy is the route, the exit or the site.
Reference links
4
Proxy302 product facts and price list
Product observation · Confirmed on:
Product facts checked on 10 November 2026 against the console, backend and price list: lease terms, prices (US$, 1 PTC = US$1), protocols and ports, no free trial.
Read on 17 November 2026: no timeout by default; the connect timeout is the wait to establish a connection and should be slightly more than a multiple of 3; the read timeout is the wait between bytes from the server; one number applies to both, a (connect, read) tuple sets them separately; the connect timeout applies per IP address tried; neither is a wall-clock limit. Also the Proxies and SOCKS sections: socks5h resolves DNS on the proxy and needs requests[socks].
Read on 17 November 2026: Timeout catches both ConnectTimeout and ReadTimeout; ConnectTimeout is safe to retry.
Proxy302 local test with requests 2.32.5 and urllib3 2.6.3
Local example · Confirmed on:
On 17 November 2026 we ran requests against a local server that accepts connections and never answers, a closed local port and an unroutable address, with timeout=(2, 3). An unreachable or refused proxy raised ProxyError (for the unroutable address after 2 seconds, caused by ConnectTimeoutError); a proxy that accepted the connection and stayed silent raised ReadTimeout for both http and https targets after the read value. Other versions may differ.
Ready to try it?
Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.