hyper-util
hyper-util copied to clipboard
feat(client): add RFC 8305 (Happy Eyeballs v2) support
Implement RFC 8305 as an alternative connection strategy alongside the existing RFC 6555 behavior. Default behavior remains RFC 6555 for backward compatibility. In order to enable Happy Eyeballs v2, one needs to call HttpConnector::set_connection_attempt_delay().
RFC 8305 improvements over RFC 6555:
- Address interleaving: alternates between address families (v6, v4, v6, v4...)
- Staggered attempts: starts new connections at regular intervals
- Better parallelism: multiple connections can race simultaneously
Closes https://github.com/hyperium/hyper/issues/2450
Open question: the current implementation maintains both v1 (RFC 6555) and v2 (RFC 8305), with v1 as the default for backward compatibility. However, do we really want to maintain v1, considering that Happy Eyeballs is an internal optimization and v2 achieves the same goal more effectively.