What is Socket.IO?
The primary function of Socket.IO is to act as an abstraction layer for existing realtime protocols. In particular, Socket.IO is able to connect clients with servers over a WebSocket connection, all the while handling the intricate details of the underlying protocol with a simple, understandable API. It also places focus on connection reliability, with in-built mechanisms for disconnection detection, auto-reconnect, and firewall / proxy bypassing.
Socket.IO opens a connection by using its own transport protocol negotiation method, which automatically attempts to open a WebSocket connection in the browser. If the client does not support WebSocket, a fallback is provided in the form of a long-polling connection. Either way, the Socket.IO interface remains the same. Socket.IO connections may also be multiplexed and broadcast across grouped connection channels from within the same connection.
A Socket.IO scheme can be implemented in any application that relies on event-driven, realtime data streams over WebSocket, Comet-style, or Peer-to-Peer connections. This includes, but is not limited to, instant messaging, multi-user collaboration, real-time analytics, file-sharing, and notifications.