You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Nia, Paul Tötterman, Tai, MarcyMarcy, Youfu Zhang, Bradley Wilson-Hunt, Fabian Weisshaar, Viacheslav Vasilyev, Thanatat Tamtan, Roman Sharkov and 16 more
So unfortunately, there is no clean way for a client to detect whether a HTTP server supports WebSockets over HTTP/2 without actually performing a handshake. I've emailed the working group regarding this.
Reacted by bobby, tsingson, Nia, QuantumGhost, Paul Tötterman, Tai, Afriza N. Arief, Gibran Iqbal, 量子Bug and Stefan Betz
So it looks like my suggestion won't be implemented. The only way to implement this then is to take a HTTP2 flag on the dial options or keep a global cache.
For the server, I'm sure we can do this transparently but will require some collaboration with net/http.
Activity
nhooyr commentedon Sep 6, 2018
Definitely worth reading https://tools.ietf.org/html/rfc8441
nhooyr commentedon Mar 29, 2019
This does mean we cannot expose net.Conn directly as part of the API interface like gorilla/ws because there may not be a net.Conn to expose.
nhooyr commentedon Apr 5, 2019
So unfortunately, there is no clean way for a client to detect whether a HTTP server supports WebSockets over HTTP/2 without actually performing a handshake. I've emailed the working group regarding this.
nhooyr commentedon Apr 5, 2019
Hopefully shows up on https://lists.w3.org/Archives/Public/ietf-http-wg/2019AprJun/
nhooyr commentedon Apr 7, 2019
https://lists.w3.org/Archives/Public/ietf-http-wg/2019AprJun/0010.html
[-]HTTP/2 Support[/-][+]WebSockets over HTTP/2[/+]nhooyr commentedon May 30, 2019
So it looks like my suggestion won't be implemented. The only way to implement this then is to take a HTTP2 flag on the dial options or keep a global cache.
For the server, I'm sure we can do this transparently but will require some collaboration with net/http.
34 remaining items
mitar commentedon Sep 15, 2025
I think that importing golang.org/x/net/http2 is pretty safe and I would not call it really a dependency. :-)
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
feat: add experimental http2 support
fix(ingress): migrate WebSocket proxy off archived gorilla/websocket
feat: add experimental http2 support