Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support WebSockets over HTTP/2 (RFC8441) #5565

Closed
bt90 opened this issue Jun 5, 2023 · 10 comments · Fixed by #6567
Closed

Support WebSockets over HTTP/2 (RFC8441) #5565

bt90 opened this issue Jun 5, 2023 · 10 comments · Fixed by #6567
Labels
deferred ⏰ We'll come back to this later feature ⚙️ New feature or request upstream ⬆️ Relates to some dependency of this project

Comments

@bt90
Copy link
Contributor

bt90 commented Jun 5, 2023

https://datatracker.ietf.org/doc/html/rfc8441

The standard is already supported by Firefox and Chrome

Blocked by golang/go#53209

@bt90
Copy link
Contributor Author

bt90 commented Jun 5, 2023

As suggested by @francislavoie

https://phpc.social/@francislavoie/110492709845091053

(also thanks @icing for the idea)

@francislavoie francislavoie added feature ⚙️ New feature or request deferred ⏰ We'll come back to this later upstream ⬆️ Relates to some dependency of this project labels Jun 5, 2023
@WeidiDeng
Copy link
Member

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?

@WeidiDeng
Copy link
Member

By the way, x/net/websocket is discontinued. This should go to x/net/http2 instead.

@WeidiDeng
Copy link
Member

This actually will partly modify reverse_proxy's handling of 101 response based on whether client is using http2 if it is ever implemented.

@WeidiDeng
Copy link
Member

Related changes required here upstream.

@mholt
Copy link
Member

mholt commented Jun 6, 2023

Thank you for looking into this, @WeidiDeng 😃

@bt90
Copy link
Contributor Author

bt90 commented Jun 6, 2023

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.

See golang/go#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 😉

@zhangjun-qcqi
Copy link

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

@WeidiDeng
Copy link
Member

@bt90 You can try 6567 to see how it actually works.

@bt90
Copy link
Contributor Author

bt90 commented Sep 28, 2024

Thanks, will try to test it in the upcoming days :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deferred ⏰ We'll come back to this later feature ⚙️ New feature or request upstream ⬆️ Relates to some dependency of this project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants