http://stackoverflow.com/questions/16392260/which-websocket-library-to-use-with-node-js
http://stackoverflow.com/questions/16392260/which-websocket-library-to-use-with-node-js
Currently there is a plethora of websocket libraries for node.js, the most popular seem to be:
However I can't find any solid concrete comparisons between any of them... Apparently Socket.io was awesome, but has become quite dated and has failing builds. Both ws and websocket-node claim they are the fastest. And engine.io seems new, but a lot heavier than the lighter aletarntives. It would be amazing if we or someone could put together an answer that serves as a guide on which socket library to use and when, as well as a comparison between them. |
|||||||||||||||||||||
|
Getting the ball rolling with this community wiki answer. Feel free to edit me with your improvements.
When to use:
|
|||||||||||||||||||||
|
UPDATE: Socket.IO 1.0 is releasedSocket.IO v0.9 is outdated and a bit buggy, and Engine.IO is the interim successor. Socket.IO v1.0 (which will be released soon) will use Engine.IO and be much better than v0.9. I'd recommend you to use Engine.IO until Socket.IO v1.0 is released. "ws" does not support fallback, so if the client browser does not support websockets, it won't work, unlike Socket.IO and Engine.IO which uses long-polling etc if websockets are not available. However, "ws" seems like the fastest library at the moment. See my article comparing Socket.IO, Engine.IO and Primus: https://medium.com/p/b63bfca0539 |
|||||||||||||
|
npm ws was the answer for me. I found it less intrusive and more straight forward. With it was also trivial to mix websockets with rest services. Shared simple code on this post.
|
|||||||||||||
|
protected by Tushar Gupta Oct 20 '14 at 7:20
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.
Would you like to answer one of these unanswered questions instead?