News for hackers. Stuff that matters.
Re:Socket.IO P2P by yid on Wednesday July 15, 2015 @12:35PM (#9892300)
Absolutely! I've had terrible experiences with vanilla socket.io regarding reconnections, performance, and reliability. This is even after the 1.0 release.

Lately, I've been using primus [1], which is an API unification layer for socket.io, sockjs, faye, and native websockets. Swapping one engine for another is trivial, and they've taken pains to abstract a core subset of functionality.

[1] https://github.com/primus/primus

Re:Socket.IO P2P by amluto on Wednesday July 15, 2015 @01:19PM (#9892632)
Agreed. Mostly quoting myself from earlier this year: I don't normally like bashing open-source projects, but socket.io should not be used. It may be noob-friendly, but that's just because it does things so automatically that you can't really use it correctly. When I was a websockets noob, I used socket.io briefly, and it was a complete waste of time.

See, for example, https://github.com/Automattic/socket.io-client/issues/572 (closed without comment).

SockJS is much better, as is raw websockets. Presumably Primus, too, although I'm a bit surprised that one can come up with a sensible interface that can be layered over both Socket.io and anything else.

Re:Socket.IO P2P by STRML on Wednesday July 15, 2015 @01:14PM (#9892585)
+1 for Primus. We moved to it on BitMEX from a custom SockJS + Mux-demux setup and the transition was painless. We now get the ability to change transports based on client (so our API clients get the very fast standards-compliant node `ws` library, while browser clients get engine.io). We also gained reliable heartbeating which was a big win.

I've found the devteam to be really responsive and their choices of abstractions appear to work well.