Engine.io or SockJS, which one to choose?

Have you looked at Primus? It offers the cookie requirements you mention, it supports all of the major ‘real-time’/websocket libraries available and is a pretty active project. To me it also sounds like vendor lock-in could be a concern for you and Primus would address that.

The fact that it uses a plugin system should also a) make it easier for you to extend if needed and b) may actually have a community plugin that already does what you need.

Which of the 2 libraries do you prefer and for which reason? Do you use them in production?

I have only used SockJS via the Vert.x API and it was for an internal project that I would consider ‘production’, but not a production facing consumer app. That said, it performed very well.

Which one will likely be maintained more actively and could have a major advantage over the other in the future?

Just looking over the commit history of Engine.io and SockJS, and the fact that Auttomatic is supporting Engine.io makes me inclined to think that it will be more stable, for a longer period of time, but of course that’s debatable. Looking at the issues for Engine.io and SockJS is another good place to evaluate, but since they’re both split over multiple repos it should be taken with a grain of salt. I’m not sure where/how Automattic is using Engine/Socket.io, but if it’s in WordPress.com or one of their plugins, it has substantial production-at-scale battle testing.

edit: change answer to reflect cookie support confirmed by Primus author in comments below

Leave a Comment