There are various libraries that let you create a ws server (similar to how express lets you create an HTTP server)
We’ll be using the ws library today.
To run this project locally, follow these steps:
- Clone the repository:
git clone https://github.com/sumitnair26/Websockets
-
Navigate to the project directory:
cd Websockets -
Install dependencies:
npm install -
Run the development server:
tsc -b node dist/index.js
-
URL ws://localhost:8080
-
Click on Connect.
-
Run in Multiple Tabs
-
Add Message and click on Send.
-
Sent Message can be seen on all connections.
-
Navigate to the Frontend directory:
cd frontend -
Install dependencies:
npm install -
Run the development server:
npm run dev
The application will start at http://localhost:5174/ by default.
-
TypeScript
-
Node.js
-
React.js
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or create a pull request.






