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

HandleHttps should not send 200 before calling ConnectHijack's Hijack func #376

Closed
riraccuia opened this issue Mar 28, 2020 · 1 comment
Closed

Comments

@riraccuia
Copy link
Contributor

riraccuia commented Mar 28, 2020

*ProxyHttpServer.handleHttps() currently writes a HTTP/1.0 200 OK back to the client connection before ConnectHijack's Hijack function is invoked.

RFC 2817 States:

5.3 Establishing a Tunnel with CONNECT

   Any successful (2xx) response to a CONNECT request indicates that the
   proxy has established a connection to the requested host and port,
   and has switched to tunneling the current connection to that server
   connection.

It should be therefore up to the Hijack() method implementer to send the http 200 upon confirming that the destination (wether it was changed or not) is reachable.

This makes it impossible to cascade the http 502 back to the client in case we wanted to abort prematurely (e.g.the target address is unavailable) #376

@ErikPelli
Copy link
Collaborator

#377 fixed this

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

No branches or pull requests

2 participants