Before universal WebSocket
In 2010 WebSocket is still in draft, browser support fragmented (IE8/9 no). A library is needed that abstracts real-time on Node with fallback to long polling, streaming, JSONP. Socket.IO was created in 2010 by Guillermo Rauch (later founder of Vercel).
The 1.0 release
Socket.IO 1.0 is published on 28 May 2014. Complete rewrite separating the transport layer (engine.io) from the application protocol. MIT licence.
// server
const io = require('socket.io')(httpServer);
io.on('connection', (socket) => {
socket.emit('welcome', 'hi');
socket.on('chat', (msg) => io.to('room1').emit('chat', msg));
});
// client
const socket = io('wss://api.example.com');
socket.on('welcome', (m) => console.log(m));
Features
- Transport fallback — WebSocket → long polling automatic
- Auto-reconnect with exponential backoff
- Rooms — broadcast to socket groups
- Namespaces — multiplexing on single connection
- Acknowledgements — callback for receipt guarantee
- Binary support — ArrayBuffer, Blob
- Redis adapter — multi-process/multi-server scaling
- Middleware — auth, logging
Use cases
- Chat and messaging
- Browser push notifications
- Real-time collaboration (shared cursors, typing indicator)
- Live dashboards — monitoring, analytics
- Web multiplayer gaming
- Shared drawing apps
Competitors
- ws — pure Node WebSocket library, faster, no fallback
- Primus — abstraction over multiple transports
- SockJS — similar, Node + browser
In the Italian context
Socket.IO is spreading rapidly in Italian Node.js projects: customer support chat, collaborative platforms, real-time e-commerce notifications, trading desks and first IoT dashboards.
References: Socket.IO 1.0 (28 May 2014). Guillermo Rauch (Vercel founder). MIT licence. Engine.io transport layer. Rooms, namespaces, ack.
