fix(skysocks): serve status.skysocks in-process even when disconnected from the exit - #4204
Merged
Merged
Conversation
…d from the exit skysocks-client dials the exit BEFORE it binds :1080 (the live Client is built from the yamux session conn), so while the client is still connecting or the exit route group never came up, nothing listened on :1080 and a browser request for the reserved status.skysocks diagnostic host got connection-refused — exactly when a user wants to see why the proxy is not connected. A new sessionless listener (skysocks.ServeDisconnected) now owns :1080 during the dial window and answers each SOCKS5 connection locally: reserved diagnostic hosts (proxystatus.Match) are rendered in-process with zero exit involvement, on any port, while every real target still gets the branded "building a route" interstitial (plaintext HTTP) or is declined (other ports). No real traffic is ever tunneled here — there is no exit to tunnel to — so listening-but-not-connected only surfaces the local diagnostic/interstitial pages, never silently serving or blackholing real requests.
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.
skysocks-client dials the exit before it binds :1080 (the live
Clientis built from the yamux session conn), so while the client is still connecting — or the exit route group never came up — nothing listened on :1080 and a browser request for the reservedstatus.skysocksdiagnostic host got connection-refused. That is exactly when a user wants to see why the proxy is not connected.A new sessionless listener (
skysocks.ServeDisconnected) now owns :1080 during the dial window and answers each SOCKS5 connection locally: reserved diagnostic hosts (proxystatus.Match) are rendered in-process with zero exit involvement, on any port, while every real target still gets the branded "building a route" interstitial (plaintext HTTP) or is declined (other ports).No real traffic is ever tunneled on this path — there is no exit to tunnel to — so a listening-but-not-connected :1080 only surfaces the local diagnostic/interstitial pages, never silently serving or blackholing real requests. Extends the earlier session-down (#4128) and dead-but-route-open (#4198) coverage to the no-session-at-all state. New tests cover status.skysocks served on a non-80 port with no session, a real host getting the interstitial, and a non-HTTP port declined.