Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP CONNECT: handle early server packets #2746

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mjameswh
Copy link

@mjameswh mjameswh commented May 10, 2024

When using an HTTP CONNECT proxy, it is possible for the server's first HTTP2 packet to reach the client before the node's HTTP library even starts parsing the HTTP HTTP/1.1 200 Connected response.

When that happens, node's HTTP response parser may take these extra bytes (i.e. the server's first HTTP2 packets) out of the socket into its parsing buffer. That means that these extra bytes will not be emitted through the tunneled socket provided on the connect event. Instead, these extra bytes are provided through the head parameter of the connect event.

This PR reinjects these extra bytes (if any) into the tunneled socket.

Fixes #2744.

Copy link

CLA Not Signed

@murgatroid99
Copy link
Member

This change looks good, but I can't merge it until you sign the CLA.

@mjameswh
Copy link
Author

I know. I'm waiting for legal department.

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.

RST_STREAM with code 2 / system error -505 when using HTTP CONNECT proxy
3 participants