This is a simple demonstration of WebSockets in JavaScript.
Most part of the code is used to accomplish the connection between the server and its clients. The main functionality of this application is to send messages to the server who then broadcats the message to all connected clients. The clients show all messages they recieve in a list. Each client can have a different username in order to distinguish between them.
- Install the dependencies:
npm ci
- Execute the main.js server script with Node.js:
npm start
All you need to do to run the client which will connect to the server via localhost is opening the client\index.html
file.