If you’re not familiar with WebSockets, WebSockets allows you to communicate between a client and a server in a nonstandard way. The traditional way that a client and a server communicate is by following the request-response cycle. With WebSockets, however, there is an open connection established between the server and the client. This open connection makes it possible for both of them to communicate instantly.

Socket.io improves on WebSockets by including added features, such as broadcasting over a network or supporting connections established in the presence of proxies or load balancers. WebSocket does not support any of this.

Without getting into many theoretical details as to what Socket.io can do, let us build a mini chat application to demonstrate its use-case. In this tutorial, you are going to do that using just Node.js and a static HTML web page.

#NodeJS #Socket.io #WebSockets

Build a Chat App with Node.js and Socket.io
24.25 GEEK