caddy
caddy copied to clipboard
Support WebSockets over HTTP/2 (RFC8441)
https://datatracker.ietf.org/doc/html/rfc8441
The standard is already supported by Firefox and Chrome
Blocked by https://github.com/golang/go/issues/53209
As suggested by @francislavoie
https://phpc.social/@francislavoie/110492709845091053
(also thanks @icing for the idea)
According to rfc 8441, websocket over h2 requires SETTINGS_ENABLE_CONNECT_PROTOCOL to be sent by h2 server, currently golang doesn't allow sending custom h2 settings.
Also the method has been changed from GET to CONNECT, so connection establishment is somewhat different. Do you know of any server that supports websocket over h2 so I can test it @bt90?
By the way, x/net/websocket is discontinued. This should go to x/net/http2 instead.
This actually will partly modify reverse_proxy's handling of 101 response based on whether client is using http2 if it is ever implemented.
Related changes required here upstream.
Thank you for looking into this, @WeidiDeng :smiley:
According to rfc 8441, websocket over h2 requires
SETTINGS_ENABLE_CONNECT_PROTOCOLto be sent by h2 server, currently golang doesn't allow sending custom h2 settings.
See https://github.com/golang/go/issues/53208
establishment is somewhat different. Do you know of any server that supports websocket over h2 so I can test it @bt90?
@icing is adding support for Apache :wink:
Lighttpd supports ws over h2 since version 1.4.65.
Please check links below: https://redmine.lighttpd.net/issues/3151 https://www.phoronix.com/news/lighttpd-1.4.65
@bt90 You can try 6567 to see how it actually works.