Repository navigation
fix(net): expose the SOCKS5 proxy-connect failure stage - #42
Merged
Merged
Conversation
socks5_last_error() reports "connection refused" both when the proxy TCP connect fails and when the proxy rejects CONNECT with REP=0x05. Callers that classify errors cannot tell "proxy unreachable" from "target rejected" without joining the two pieces of information. Track the stage in uvcpp_tcp_client: set a flag when the proxy TCP connect, its DNS resolution, or the connect timeout fails; clear it when a new SOCKS5 attempt starts; expose socks5_proxy_connect_failed(). Forward the accessor from uvcpp_http_client. Add a functional test covering a dead proxy, a proxy-rejected target, a wrong password and the successful path.
The new public/private members shift uvcpp_tcp_client and uvcpp_http_client line numbers; move the documented references by the same offsets and refresh doc_line_refs.lock.
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
socks5_last_error()reportsconnection refusedin two very different cases:REP=0x05— the proxy is reachable and the target refused.Callers that classify failures (for example uvscope's
proxy_unreachablevstarget_rejected) currently cannot tell them apart from the public API.Change
uvcpp_tcp_client: set a flag on proxy connect / DNS / connect-timeout failures, reset it when a new SOCKS5 attempt starts.socks5_proxy_connect_failed()(read-only) and forward it fromuvcpp_http_client.Verification
Also exercised by uvscope's smoke suite on v1.8.0 + this patch: dead proxy →
proxy_unreachable, proxy REP=0x05 →target_rejected, wrong credentials →auth_failed.