A simple real-time chat application built with NestJS and Socket.io to demonstrate WebSocket implementation. This project showcases bidirectional communication between server and clients, allowing multiple users to exchange messages instantly through WebSocket connections.
- Real-time messaging using WebSocket (Socket.io)
- Multiple users support with broadcast messages
- User connection/disconnection notifications
- Clean and responsive UI
- Simple vanilla JavaScript frontend
# Install dependencies
npm install
# Start the server
npm run start:devThe WebSocket server will be running at http://localhost:3002
The frontend is a simple HTML file. To test it, you have several options:
Option 1 - Opening directly in the browser:
Simply open the index.html file directly in your browser.
Option 2 - Using Python:
# In the folder where the index.html file is located
python3 -m http.server 8000Access: http://localhost:8000
Option 3 - Using http-server (Node.js):
npm install -g http-server
http-server -p 8000Access: http://localhost:8000
- Open the frontend in multiple browser tabs
- Type messages and see real-time communication between tabs
- Check the backend console to see connections and messages being received
