Source code for a very simple Node.js chat application using Socket.IO.
This code is an improvement over the example Getting Started guide on the Socket.IO website.
From their website:
Here are some ideas to improve the application:
- Broadcast a message to connected users when someone connects or disconnects
- Add support for nicknames
- Don’t send the same message to the user that sent it himself. Instead, append the message directly as soon as he presses enter.
- Add “{user} is typing” functionality
- Show who’s online
- Add private messaging
Share your improvements!
The improvements are:
- Users can set nicknames
- List of online users
- Typing indictor when user is typing
- Broadcast message when someone connects or disconnects
-
Clone or download this repo;
-
Open the directory in terminal;
-
Install Node modules with
npm install
; -
Run the Node application with
node index.js
; -
Open the application on the browser at localhost:3000.