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

Implement HTTP CONNECT with Hypercorn #169

Open
pquentin opened this issue Dec 6, 2023 · 0 comments
Open

Implement HTTP CONNECT with Hypercorn #169

pquentin opened this issue Dec 6, 2023 · 0 comments

Comments

@pquentin
Copy link

pquentin commented Dec 6, 2023

The urllib3 test suite includes an HTTP/1.1 proxy that supports CONNECT. This works by first establishing an HTTP connection, and then exchanging raw bytes over TCP. When porting this to Hypercorn, I realized that the ASGI protocol offers no way of exchanging raw bytes or getting access to the transport (django/asgiref#112, encode/uvicorn#400).

(This might not be an issue for HTTP/2 where CONNECT works with DATA frames, but h2 does not currently support CONNECT python-hyper/h2#319 anyway and outright rejects requests made by curl --proxy-http2. So let's make this issue about HTTP/1.1)

The two options are:

  • Implement absolute URI and CONNECT in Hypercorn itself
  • Give access to the transport, without any guarantees made

urllib3 currently does the latter, see urllib3@7269fd3.

Would you consider reviewing a contribution along those lines?

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

1 participant