Learning socket.io to make a persistent connection between clients and server by building a small chat application
Web Sockets is a communication protocol which provides a full duplex and persistent connection between client and server. WebSocket is especially great for services that require continuous data exchange, e.g. chat applications, online games, real-time trading systems and so on.
Socket.IO is a JavaScript library for realtime web applications. It enables realtime, bi-directional communication between web clients and servers. It has two parts: a client-side library that runs in the browser, and a server-side library for Node.js. Both components have a nearly identical API. Like Node.js, it is event-driven.
Socket.IO primarily uses the WebSocket protocol with polling as a fallback option,[3] while providing the same interface. Although it can be used as simply a wrapper for WebSocket, it provides many more features, including broadcasting to multiple sockets, storing data associated with each client, and asynchronous I/O.