Skip to content

fix: apply connect timeout to SOCKS5 handshake reads - #1100

Open
ltsyk wants to merge 2 commits into
encode:masterfrom
ltsyk:fix/socks5-handshake-timeout
Open

fix: apply connect timeout to SOCKS5 handshake reads#1100
ltsyk wants to merge 2 commits into
encode:masterfrom
ltsyk:fix/socks5-handshake-timeout

Conversation

@ltsyk

@ltsyk ltsyk commented Jul 30, 2026

Copy link
Copy Markdown

Summary

SOCKS5 handshake stream.read() calls ignored connect timeout, so hung proxies blocked forever (issue #1089).

Change

Thread timeout into _init_socks5_connection and pass it to every stream.read.

Fixes #1089

ltsyk and others added 2 commits July 30, 2026 08:44
Pass connect timeout to SOCKS5 stream.read (issue encode#1089)
Mirror the sync timeout parameter through _init_socks5_connection
so unasync stays in sync and async handshakes honor connect timeout.
@ltsyk

ltsyk commented Aug 1, 2026

Copy link
Copy Markdown
Author

Fixed the CI unasync mismatch: the connect timeout is now threaded through the async _init_socks5_connection path as well (signature + stream.read(..., timeout=timeout) + call-site kwargs), matching the sync side so scripts/unasync.py --check is clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_init_socks5_connection ignores timeout — SyncStream.read() puts socket into infinite blocking mode

1 participant