-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
HTTP/2 server support? #68
Comments
@IngwiePhoenix Yes, good idea. I will look into it this weekend. |
@IngwiePhoenix I would prefer to wait a bit longer before allowing HTTP2 support in SC. I think we could in theory add support for HTTP2 before it becomes part of Node.js core, but looking through the issues list: https://github.com/molnarg/node-http2/issues - It seems like the http2 module is still in its early stages. I will keep an eye on the project and when it looks like it's stable enough for production use, we can allow people to use it instead of the regular http1.1 - Probably by setting the prototocol option of SC to 'http2'. We can leave this issue open as a reminder to check up on it from time to time - It might not be too far off. |
At first glance, it looks like it may be possible to make a small change to SC to allow providing a custom server object (this could be a HTTP2 server or SPDY server or whatever). I will try to look into this sometime next week. |
When instantiating the main SocketCluster instance (in server.js), you can now pass an optional 'httpServerModule' - It should be a string (module name/path). So if you want to use the http2 module, you can set it to 'http2'. You can specify any module but it has to conform to the standard Node.js http API (which http2 does). Note that http2 doesn't appear to work with express yet though, so if your SC worker uses express then it will throw a weird error. See molnarg/node-http2#100 Use at your own risk :p |
@jondubois http2 is stable now. I tried EDIT: I found that we could override |
I just wondered if there is a way that a SocketCluster server would be able to use a HTTP/2 server. I saw one on NPM that supports the actual http API.
https://www.npmjs.com/package/http2
The text was updated successfully, but these errors were encountered: