-
Notifications
You must be signed in to change notification settings - Fork 9
HTTP 3
HTTP/3 significantly reduces connection times by replacing TCP + TLS with QUIC, leading to substantial performance improvements in H@H usage scenarios.
hath-rust includes experimental support for HTTP/3, which can be enabled using the --enable-h3 option.
Browsers typically include automatic fallback mechanisms, so enabling HTTP/3 generally doesn't affect quality.
However, HTTP/3 and QUIC are relatively new technologies. Before enabling HTTP/3 support, please review the considerations below.
QUIC relies on UDP as its underlying protocol. If you have a firewall or port forwarding configured, ensure the relevant UDP port is also opened.
Current implementations of HTTP/3 and QUIC are not fully optimized, which may lead to higher CPU usage.
This is usually not a significant issue, as the load can be distributed across multiple CPU cores, and the number of HTTP/3 requests is relatively low.
Switching from TCP to QUIC means that buffers previously managed by the operating system are now handled by the application itself.
As a result, while the program's memory footprint may increase, the overall system memory usage should not change dramatically.
When a browser connects for the first time, it doesn't know HTTP/3 is available, so it won't use it initially. After receiving the first response, the browser learns about HTTP/3 availability via the Alt-Svc header and will switch to HTTP/3 for subsequent requests.
Additionally, due to the H@H mechanism and the fact that many third-party readers do not yet support HTTP/3, actual HTTP/3 usage remains low. Based on statistics from my own client, only about 10% of requests use HTTP/3.
Although HTTP/3 is technically superior to HTTP/1.1, real-world factors can reduce its effectiveness. For example, ISP-imposed rate limits on UDP traffic or firewalls that are restrictive toward UDP may cause connection failures.
On low-latency, low-packet-loss networks, QUIC performance might be slightly inferior to traditional TCP. However, on high-latency or high-packet-loss networks, QUIC is typically much faster than TCP.
hath-rust --enable-h3
Ensure Docker forwards the UDP port to the container as well.
docker run -p 443:443 -p 443:443/udp ... ghcr.io/james58899/hath-rust --enable-h3
To verify HTTP/3 is working properly, you can download curl that supports HTTP/3 from static-curl.
Example command:
./curl -v -k --http3 https://127.0.0.1:443