Please correct me if this question is a duplicate. Regarding node.js, I'm using socket.io for real-time socket connection from the client application to the server application. I just heard about engine.io, is engine.io a replacement for socket.io? I could not find any useful information on engine.io website
Thanks in advance
Engine.IO is the implementation of transport-based cross-browser/cross-device bi-directional communication layer for Socket.IO.
In your code example, io is a Socket.IO server instance attached to an instance of http. Server listening for incoming events. The socket argument of the connection event listener callback function is an object that represents an incoming socket connection from a client.
Socket.IO is way more than just a layer above WebSockets, it has different semantics (marks messages with name), and does failovers to different protocols, as well has heartbeating mechanism. More to that attaches ID's to clients on server side, and more. So it is not just a wrapper, it is full-featured library.
Pusher is the category leader in delightful APIs for app developers building communication and collaboration features. On the other hand, Socket.IO is detailed as "Realtime application framework (Node. JS server)". Socket.IO enables real-time bidirectional event-based communication.
engine.io is a lower level library than socket.io.
Engine is to Socket.IO what Connect is to Express.
If you want the lower level abstraction, use engine.io. If you want a websocket abstraction, keep using socket.io.
engine.io is of more interest to you if you're building a library/framework on top of socket.io.
socket.io is of more interest to you if you're building an application on top of socket.io.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With