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

Supporting CONNECT requests. #1014

Open
georgyo opened this issue Jan 6, 2024 · 0 comments
Open

Supporting CONNECT requests. #1014

georgyo opened this issue Jan 6, 2024 · 0 comments
Labels

Comments

@georgyo
Copy link

georgyo commented Jan 6, 2024

While attempting to create a forward proxy with cohttp, I could not figure out how I would handle a CONNECT request.

There is an example cohttp proxy in the code base here: cohttp-lwt-unix/bin/cohttp_proxy_lwt.ml, and it works well with forwarding http requests. Output of that looks like this

But https over a proxy work a bit differently. The client sends a CONNECT request, which opens up a bi-directional communication stream. And then only after the client gets 200 Connection established, does it send over the actual request. The proxy itself does not do any SSL decryption, it merely forward the bytes back and forth.

This is what the example code does Cohttp proxying https request
And this is what it should look like is this

Cohttp's request object received by the handler has no way start this bidirectional communication, at least not that I can see. This is somewhat related to #501, but I think this deserves it own ticket since it a distinct feature.

@mseri mseri added the Feature label Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants