Differences between socket.io and websockets
Asked 07 September, 2021
Viewed 1.9K times
  • 60
Votes

What are the differences between socket.io and websockets in node.js?
Are they both server push technologies? The only differences I felt was,

  1. socket.io allowed me to send/emit messages by specifying an event name.

  2. In the case of socket.io a message from server will reach on all clients, but for the same in websockets I was forced to keep an array of all connections and loop through it to send messages to all clients.

Also, I wonder why web inspectors (like Chrome/firebug/fiddler) are unable to catch these messages (from socket.io/websocket) from server?

Please clarify this.

8 Answer