A basic unsecure, public chatroom to test socket.io with several features:
- a way to capture and save the username of every client that connects to the server,
- A notification system that announces to all clients whenever a user enters or leaves the chat, as well as a report of all the users still connected
- A way to make sure the same user isn’t logged in twice (and not allow the second attempt)
- Ability to log in to different rooms
- Express + Node
- socket.io
- Download the repo & run
npm i
- Run
node server.js
- Go to
localhost:3000
on several different browser tabs, "logging in" as different usernames on each one - Send a message from any tab and see it appear on the others
- To test the rooms feature, go to
localhost:3000/rooms/room_name
and replaceroom_name
with whatever room you want to create
- The Express server is contained in
server.js
- The client is contained in
client.html
(including JS)