Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between engine.io and socket.io?

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

like image 387
L N Avatar asked Dec 17 '11 04:12

L N


People also ask

What is Socket.IO engine?

Engine.IO is the implementation of transport-based cross-browser/cross-device bi-directional communication layer for Socket.IO.

What is the difference between IO and Socket?

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.

Which is better Socket.IO or WS?

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.

Which is better Socket.IO or pusher?

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.


1 Answers

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.

like image 75
Raynos Avatar answered Oct 16 '22 07:10

Raynos