Working with WebSockets using Socket.io
-
Go into the
\server
directory and runnpm install && npm start
to launch the server side of the app. -
Go into the
\app
directory and open theindex.html
to launch the client side of the app (JS and CSS are inlined in the html, so it could be used without Live Server or other similar tools). Do this several times in different tabs or browser windows. Each tab or browser window will be a client. -
Enter name, your message and click send. The message will be sent to the server and emited to all clients, you will see the message appears in other tabs or browser windows.