We started out this chapter by looking at the current problems facing our application. Following this, we looked at how web sockets can solve our problem and found a fully featured implementation of web sockets in the socket.io library. The basics of socket.io were covered in addition to how it was going to work with the current application. We then went on to actually implementing the socket.io library in both the client-side as well as the server-side application code and finally inspected the network activity in both cases to observe the difference.
Although web sockets seem like a solution to all our problems, there are still some drawbacks that we should consider:
- Web sockets are more resource-intensive compared to HTTP calls since each connection to the server is maintained as a separate instance and exists for as long as the client is active. HTTP calls, on the...