An example of Socket.io + Node.js
Since it’s bi-directional, it uses a WebSocket protocol with long-polling as it’s fallback option. The focus on real-time analytics, binary streaming, instant messaging, and document collaboration. Some of their notable clients are Microsoft Office, Yammer, and Zendesk.
In May 2017, they released Socket.io 2.0. These changes included uws as the default WebSocket engine and developers can create custom parsers.
Citing Vaibhav Gautam, “Libraries like socket.IO are needed when we need real time in our app. Let me explain this in little more detail. lets assume that you are developing a game, which is multiplayer and 2 or more users can play that simultaneously. Then in that case you won’t be making HTTP or HTTPS calls because of many reasons and one of them is that their packet size is large and other is that these calls are very slow. In such scenarios we use libraries like sockets to send and receive data to and from server. sockets are really fast and are capable of sending only those data packets which are needed. using HTTP programming you can never create any multiplayer game or any app which will be interacting with server on realtime basis.”