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

Add Experimental HTTP/3 Support #1558

Closed
seanmonstar opened this issue Jun 8, 2022 · 2 comments
Closed

Add Experimental HTTP/3 Support #1558

seanmonstar opened this issue Jun 8, 2022 · 2 comments
Labels
pr-welcome The feature is welcome to be added, instruction should be found in the issue.

Comments

@seanmonstar
Copy link
Owner

The h3 crate is mostly working, and while the hyper 1.0 roadmap has changes need to allow new HTTP versions which don't use TcpStream to be added, it would be helpful to try out the h3 crate before it appears in hyper. To that end, I believe adding "experimental" (or "unstable") support to reqwest is a great way to just that.

Overall, I'd guesstimate this is a medium-sized issue. Even if familiar with how hyper and reqwest usually work, I'd imagine it would take a few hours to pipe everything through. A few more if you're not familiar.

Here's a (potentially incomplete) list of what would need to be done:

  • Add an optional git dependency on h3-quinn (s2n-quic-h3 could also be used).
  • Edit reqwest's async_impl::client::Client to hold both a hyper::Client but also a small pool of HTTP/3 connections.
  • In Client::request, if the version is HTTP_3, then use the h3 pool.
    • The DNS resolver would need to be cloned for the h3 pool.
    • The TLS config would also need to be cloned.
    • It may help to look at the h3 client example.
    • If a connection doesn't exist for the target authority, resolve the address, create a UdpSocket, and pass it to quinn.
    • Once ready, spawn the h3::client::Driver into Tokio.
    • Use the SendRequest to start sending a request.
  • Adjust the async_impl::response::Response and Body to be an enum of the regular repr, and another variant for the h3 types. Or boxed them if it's easy to do so.
@seanmonstar seanmonstar added the pr-welcome The feature is welcome to be added, instruction should be found in the issue. label Jun 8, 2022
@jfaixo

This comment was marked as outdated.

@seanmonstar
Copy link
Owner Author

This was done in #1599, and released in v0.11.15!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-welcome The feature is welcome to be added, instruction should be found in the issue.
Projects
None yet
Development

No branches or pull requests

2 participants