Skip to content

fix(http): close failed CONNECT handshakes - #449

Open
fhgffy wants to merge 1 commit into
nadoo:mainfrom
fhgffy:fix/http-connect-cleanup
Open

fhgffy wants to merge 1 commit into
nadoo:mainfrom
fhgffy:fix/http-connect-cleanup

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 13, 2026

Copy link
Copy Markdown

Close the upstream connection when the HTTP CONNECT handshake fails. The dialer currently leaves it open after a write failure, an unreadable status line, or a rejected status, and ignores malformed response headers after a 200 response.

Return header parsing errors and close the buffered connection on every failed handshake. A successful tunnel still retains bytes buffered after its headers. Tests exercise each failure path and a successful tunnel with an immediate payload.

Validation (Go 1.27.2, Windows/amd64): go test -p 1 ./... -count=1, go vet -p 1 ./..., and go build -p 1 ./....

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.

1 participant