akamai / hface

Hackable HTTP/{1,2,3} {client,server,proxy}
https://hface.readthedocs.io
Apache License 2.0
30 stars 2 forks source link

Happy eyeballs for HTTP/3 #17

Open mila opened 1 year ago

mila commented 1 year ago

AnyIO implements Happy eyeballs for TCP connections. It would be nice to have something similar for QUIC and HTTP/3 connections.

mila commented 1 year ago

A problem with happy eyeballs for QUIC is that it has to be implemented at a different layer.

HTTP/3 in hface is designed as HTTP over UDP, hiding the QUIC layer in the middle. We cannot do the happy eyeballs at the UDP layer, so it has to be at the Connection layer, mostly likely in HTTPOverQUICOpener. But today, the opener does not send anything.

We can update the HTTPOverQUICOpener.__call__() to call Connection.open() or a similar method automatically, but it would be strange if the connection class had a method that users are not supposed to use (because it's called before the connection is given to them). Maybe this opening logic could be pushed to Transport classes (#8).