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

Creating websocket.Server from http2.createSecureServer #1293

Closed
cTn-dev opened this issue Feb 4, 2018 · 3 comments
Closed

Creating websocket.Server from http2.createSecureServer #1293

cTn-dev opened this issue Feb 4, 2018 · 3 comments

Comments

@cTn-dev
Copy link
Contributor

cTn-dev commented Feb 4, 2018

Hi (sorry for creating the ticket here, stackoverflow didn't seem like the right place for this).

I was wondering if there is a way, or if it will be possible to create a websocket server on top/from the http2.createSecureServer instance.

Right now i have to create an additional regular https.server and then create the websocket server from this instance, this works fine but it forces me to have another port open (which makes sense).

I am aware that http2 in node is still in "experimental" stage, but better support for it in ws would be great.

@lpinca
Copy link
Member

lpinca commented Feb 4, 2018

There is no support for WebSocket over HTTP/2. See https://daniel.haxx.se/blog/2016/06/15/no-websockets-over-http2/, nodejs/node#15230.

@cTn-dev
Copy link
Contributor Author

cTn-dev commented Feb 4, 2018

Oh, i didn't know :/ thank you very much for the links.
Loving the module btw!

@linuxd3v
Copy link

linuxd3v commented Sep 23, 2021

if anyone else stumbles on this tix.
HTTP2 web-sockets are now reality - added as part of this rfc: https://datatracker.ietf.org/doc/html/rfc8441

Firefox is defaulting to websockets over http2 (if the server advertises support) - see network.http.spdy.websockets
Chrome also allegedly added support to http2 web-sockets recently:
https://www.chromestatus.com/feature/6251293127475200

Reverse proxy solutions are beginning to support http2 web-sockets as well:
https://www.haproxy.com/blog/announcing-haproxy-2-4/

There are significant changes in how ugrade happens over http2 - notably there are no Upgrade header utilized, instead extended HTTP CONNECT method is being used to bootstrap websocket protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants