socketcluster
socketcluster copied to clipboard
Integration with 'sc-uws' Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'sc-uws'
When setting wsEngine to: 'sc-uws' i get the following error:
[Error] WSEngineInitError: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'sc-uws'
I am not able to make this work on node 10 and node 11
It seems there is now a new uws package available which does not require compilation: https://github.com/uNetworking/uWebSockets.js
would integrating socketcluster with this engine be a viable option?
@pmualaba It used to be the default in SC until about 1 year ago when the author suddenly pulled the repo from GitHub without reason.
My current thinking is that uWebSockets might make sense as an optional add-on/optimization but not bundled in with SC since it will likely never be quite as portable as ws. Also, the people behind ws have a proven track record of reliability and care for their community.
Thanks! is it still correct that ws is still lacking performance wise vs uWebSockets? Its the only reason I would switch the Engine... I read about 'ws' being 300% slower then 'uws'...
@pmualaba In my tests last year, I observed slightly over 100% performance improvement for the uws socket on the back end but this was true only if sending raw string/binary messages over WebSockets and doing nothing else. As soon as you add features on top like JSON parsing, pub/sub channels, authentication/session management, custom back end logic, database connections etc... The performance of the WebSocket engine becomes less significant. For very lightweight pub/sub services however, it may still make sense to use uWebSockets though since in this case the performance gain can approach 100% (2x).
I'm running into the same issue. Temporary workaround for me is using Node 8
+1
sc-uws instead of ws
@pmualaba It used to be the default in SC until about 1 year ago when the author suddenly pulled the repo from GitHub without reason.
@jondubois what do you mean by "pulled"? If you mean "removed", then that does not seem to be the case - https://github.com/uNetworking/uWebSockets.js is on github and looks actively maintained. This is in contrast to your fork at https://github.com/SocketCluster/uWebSockets whose last commit is from about 1.5 years ago and does not compile with nodejs 10 or 12.
The documentation at https://socketcluster.io/#!/docs/api-socketcluster shouldn't mention sc-uws in
// This can be the name of an npm module or a path to a Node.js module
// to use as the WebSocket server engine.
// You can now set this to 'sc-uws' for a speedup.
wsEngine: 'sc-uws',
given that it does not compile with recent nodejs versions and looks unmaintained.
@vasild It used to be this package: https://www.npmjs.com/package/uws
It seems it was added back to npm later under a different name. The sc-uws fork was temporary and is no longer supported - It was removed from package.json. It seems it's still included in package-lock.json but that is a mistake which I will correct at some point. In any case, it's no longer included in SC on npm. You're right it should be removed from the docs. I'll look into it.
You may be able to use uWebSockets.js as the wsEngine (though I haven't tested) but you need to install it yourself separately.
Thanks for the clarifications!
uWebSockets.js cannot be used as ws Engine without error of my side, I trtied and the interface of uWebSockets.js has changed and new interface is not compliant with socket cluster. So I understand that at this point uws is not supported by socketcluster...