Before we move on, let's have a quick refresher on an important concept that we visited earlier—WebSockets.
WebSockets is a standardized Internet protocol, which allows for direct server-to-client communication over a network. This is rather unusual in the world of traditional client-server architecture, where almost all communication is initiated by the client and the server simply responds to such communication.
WebSockets makes it easy to build real-time apps because the server can dynamically push new data to the connected clients as soon as its state changes. This is ideal for chat applications, in which we would otherwise have to use more tedious and resource-consuming approaches, such as polling, in order to approximate the same effect.
For a deeper understanding of WebSockets, please refer to Chapter 5, Real-Time Data and WebSockets, where we dealt with them in depth.