CONNECT-session seam: handlers.ConnectAcceptor #44
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/multiproxy!44
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/connect-seam"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Candidate 2 of the architecture review.
Tunnel and MITM announced an accepted
CONNECTby writingHTTP/1.1 200 OKafter hijacking, and the SOCKS5 server parsed that status line back to pick its reply. The seam is now explicit: a ResponseWriter implementinghandlers.ConnectAcceptoranswers in its own protocol, found directly or behindUnwrap, ashttp.ResponseControllerdoes. Hijack-and-200 remains the HTTP adapter. With two adapters, it is a real seam.The SOCKS5 server implements
AcceptConnect, so its status-line interception,statusOfand theReadFromworkaround are deleted. Refusals still travel as HTTP status codes throughWriteHeader.Along the way:
bufio.Writer.ReadFromthey stalled over any conn withoutReadFrom, which the new pipe-based test exposedCONNECTwith 500 instead of after telling the client it is connectedBreaking for library users:
socks5.Server's ResponseWriter no longer offersHijack.TestConnectAcceptordrives both handlers through an acceptor, directly and behindUnwrap. The command's SOCKS test runs through otelhttp's wrapper. The suite passes three times in a row under-race.