-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
HTTP3/QUIC support #2723
Comments
I'd like nothing more than for Rocket to support HTTP/3, but doing so without having support in upstream As far as I can tell, quiche is the only mature HTTP/3 implementation in Rust. It's not clear to me whether the library can correctly be used in an Aside from |
I wanted to experiment, so I've landed experimental HTTP/3 support based on It works! > cd examples/tls
> cargo run
...
🚀 Rocket has launched on https://127.0.0.1:8000 (TLS + MTLS) curl -k --http3-only -v https://127.0.0.1:8000 master ●
* Trying 127.0.0.1:8000...
* Skipped certificate verification
* Connected to 127.0.0.1 (127.0.0.1) port 8000
* using HTTP/3
* [HTTP/3] [0] OPENED stream for https://127.0.0.1:8000/
* [HTTP/3] [0] [:method: GET]
* [HTTP/3] [0] [:scheme: https]
* [HTTP/3] [0] [:authority: 127.0.0.1:8000]
* [HTTP/3] [0] [:path: /]
* [HTTP/3] [0] [user-agent: curl/8.6.0]
* [HTTP/3] [0] [accept: */*]
> GET / HTTP/3
> Host: 127.0.0.1:8000
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/3 200
< content-type: text/plain; charset=utf-8
< server: Rocket
< x-frame-options: SAMEORIGIN
< x-content-type-options: nosniff
< permissions-policy: interest-cohort=()
< content-length: 13
<
* Connection #0 to host 127.0.0.1 left intact
Hello, world!% In this |
@SergioBenitez is that h3 branch something that development should be continued on? I would love to continue work on this. |
@amyipdev Yes. I'll continue to push commits to the branch. I've just now pushed a nearly "complete" version. It's likely that we'll need to rewrite/significantly improve the In short, we need to really implement Rocket/core/lib/src/listener/quic.rs Lines 84 to 107 in b2378ab
|
I'll look into it and see if there's any way I can help. |
Please let us (the s2n team) know if you need anything to make the integration easier. Ideally we can get the s2n-quic-h3 crate published so you're not having to maintain a fork. |
Currently compiling the most recent commit, noticed I had to manually enable |
What are you running? You'll only need to do that if you're trying to compile the |
Really appreciate the comment! Thank you! At the moment, aside from aws/s2n-quic#2055, the biggest issues are:
In general, it seems that most if not all of the issues I've encountered are due to |
Can you open an issue for this? I understand the ask but we'll need to figure what it looks like in practice. This would end up being essentially a "spmc channel". A naive distribution strategy for new connections could just maintain a queue and round robin. But if one of those acceptors is too slow then the load wouldn't be well-distributed and could lead to poor performance.
Yes it's still very much an early implementation... Definitely still some issues with the underlying interface that haven't been solved, too: hyperium/h3#78 |
Here's something that might be able to help on the The
Mapping this to HTTP3/quic with the current implementations is proving to be challenging because accepting a connection and reading an HTTP request is currently interleaved in a difficult-to-compose manner. As it stands, we go quic -> HTTP3 -> connection. In other words, we need to do some work with HTTP3 before we can get our hands on a valid peer connection. This doesn't seem endemic to the design, however. If we instead reverse the arrows (quic -> connection -> HTTP3), then we recover the previous design. Concretely, this would mean that Do you think it's possible to implement |
The |
@SergioBenitez good to hear, keep me posted! And if I can help in any way with polishing please let me know |
Support is ready to land on master! One key missing bit is support for mTLS over QUIC. s2n-quic makes this a bit difficult to do at the moment (aws/s2n-quic#1957). @amyipdev Can you keep tabs on the rustls update in aws/s2n-quic#2143 and mTLS in aws/s2n-quic#2129 and perhaps update our QUIC integration to 1) expose mTLS certificates and 2) not create a second |
@SergioBenitez I'll do my best! |
What's missing?
As far as I can tell, currently Rocket supports HTTP2 via enabling the HTTP2 feature, but has no support for HTTP3/QUIC. Being able to run dual HTTP3/QUIC would be a great feature for performance, particularly in network-unstable environments.
Ideal Solution
I would recommend something similar to what NGINX does - send the Alt-Svc header for HTTP/1.1 and HTTP/2 requests, take PORTNUM/tcp as HTTP/1.1/2 and PORTNUM/udp as HTTP/3/QUIC. To integrate directly via Hyper, the solutions being worked on at hyperium/hyper#1818 could be helpful.
Why can't this be implemented outside of Rocket?
Currently I reverse proxy all my services, which does let me use QUIC between clients and the reverse proxy. However, that does not work when people are running Rocket directly without a reverse proxy.
Are there workarounds usable today?
There's the previously mentioned reverse proxy solution, but that is not in-Rocket.
Alternative Solutions
No response
Additional Context
No response
System Checks
The text was updated successfully, but these errors were encountered: