seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
9.7k stars 1.09k forks source link

Implement a HTTP/3 with Fallback option #1810

Open seanmonstar opened 1 year ago

seanmonstar commented 1 year ago

This is an addition to the experimental HTTP/3 support already added (#1558). We can't use ALPN to determine if the endpoint supports HTTP/3, like we can with HTTP/2. It uses different transport protocols. But, we could do something like "Happy Eyeballs" for IPv4 and IPv6.

Such an option, if enabled, would mean we would start an HTTP/3 connection, and after some delay, if not connected, start an HTTP/1 or 2 connection, and use whichever becomes available first.

xkeyC commented 7 months ago

Http3 servers should have alt-svc: h3=":443"; ma=xxxx header. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Svc .

The client should use this header after the first http1/http2 request to determine whether it should try http3?

FireMasterK commented 7 months ago

We have an existing issue for that in #1138, however there also exists SVCB records which can also be used for http/3 negotiation: https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns