The HTTP protocol was conceived from its origins to offer one-way communications, from the server to the client. However, today’s web applications demand more than that in order to offer a richer user experience, they need information flow in both directions at the same moment that events occur.
To mitigate that need, several strategies have emerged, including long polling and Websocket. In long polling, the client keeps asking questions to the server about a certain event, while with Websocket we have at our disposal a new protocol that allows interaction between the client and the server, facilitating the transmission of data in real-time in both directions. This is where Socket.io comes in.
WHAT IS SOCKET.IO?
Installing it is as simple as executing an npm command
It is important to note that the applications made in Socket.io have a disadvantage and that is that they do not support interactions with other clients that use standard Websocket. This is because Socket.io is not an implementation of the WebSocket protocol but a real-time web communication library that uses various protocols. However, that does not mean that it is very powerful and easy to use, ideal for any project in which both the client and the server can use the same library.
For more detailed information you can see the official documentation and for being an Open Source project you can delve into its source code on Github. You can also stay up to date by subscribing to their mailing list or following them on Twitter.