avaje-jex icon indicating copy to clipboard operation
avaje-jex copied to clipboard

[Enhancement] Support HTTP/3

Open Mechite opened this issue 1 year ago • 1 comments

https://www.eclipse.org/jetty/documentation/jetty-11/programming-guide/index.html#pg-server-http-connector-protocol-http3 Jetty has a full implementation of HTTP3 (the only other implementation I have seen since flupke).

Motivation

  • Better performance (difference would be negligible right now, but once the specification has been fully standardized, it will be many times better than HTTP/2, and HTTP3 is already being used to improve performance of sites with Cloudflare, and by e.g. Google in their core products to improve responsiveness)
  • On the road to supporting WebTransport as well (nobody has made a proper implementation of WebTransport in any language except Go, but for QUIC, kwik exists, which flupke uses as well)
    • WebTransport will boost the performance of WebSockets by using QUIC as well, just like HTTP/3 is (HTTP/3 has other reasons to boost performance as well).
    • WebTransport will finally rid people of the suffering of WebRTC, and allow for UDP data streaming for e.g. audio packets, game movement, etc, or for anything that requires this unsafe data streaming (and this will boost performance as well by increasing sheer throughput by not having the behemoth of dependencies on our backends, we could finally have the four wishes in our fever dreams of encryption, congestion control, CORS/consent and a damn simple specification).

Drawbacks

  • HTTP/3 has limited support, being majorly supported by Chrome (87+ on desktop, 111+ on Android) & Firefox (88+ on desktop, 110+ on Android), but with zero support from Safari (by extension, zero iOS support). While we could theoretically do the approach documented by Jetty with the alternate service header, I have mixed opinions about making this "temporary" solution a default rather than enforcing first-class support for HTTP/3 on peoples' sites; you can see how on the Cloudflare Quic test, your first connection ends up always being a HTTP/2 one before your client caches the support for HTTP/3. All supporting browsers support this header by default so this does work as a solution nontheless.
  • WebTransport (not included with this issue but again, for the future? Jex doesn't even have WebSockets yet...) is even less supported working only on Chrome (97+ on desktop, 111+ on Android); no other browsers support it.
  • Is there demand for this outside of me?

Mechite avatar Apr 05 '23 01:04 Mechite