Open
Description
Currently httpx
is squarely focused on HTTP's traditional request / response paradigm, and there are well-established packages for WebSocket support such as websockets. In an HTTP/1.1-only world, this split of responsabilities makes perfect sense as HTTP requests / WebSockets work independently.
However, with HTTP/2 already widely deployed and HTTP/3 standardisation well under way I'm not sure the model holds up:
- implementations such as
websockets
are usually tied to HTTP/1.1 only, whereashttpx
has support for HTTP/2 (and hopefully soon HTTP/3) - we are missing out on the opportunity to multiplex "regular" HTTP request with WebSocket connections
Using the sans-IO wsproto
combined with httpx
's connection management we could provide WebSocket support spanning HTTP/1.1, HTTP/2 and HTTP/3. What are your thoughts on this?
One caveat: providing WebSocket support would only make sense using the AsyncClient
interface.