Socket.io - mwilkin-401-advanced-javascript/bend-javascript-401d2 GitHub Wiki
Socket.io is a library that provides a lot of infrastructure and handling of real-time connections for applications by setting up bi-directional communication between web clients and servers. These applications could messaging services, games, analytics, document collaboration, etc.
Key points Socket.io has two distinct parts which must be used together:
- A client-side library which runs in the browser
- A server-side library for Node.js
Socket.io also provides a way to easily broadcast to multiple sockets at a time and it works on all platforms, servers and devices.
Socket.io provides auto-connection support as well as having a built-in disconnection detection.
Socket.io is not a WebSocket implementation; it is the protocol which is established over the TCP connection. However, Socket.io will use WebSocket as a mean of transport, as necessary, also known as fall back options.
Importantly, Socket.io provides event-based communication between the browser and server.