A lightweight, terminal-based chat application built with Bash that enables real-time communication between multiple users over a local network.
- Server/Client Architecture: Host or join chat rooms with ease
- Multi-User Support: Multiple clients can connect to a single server simultaneously
- Timestamped Messages: Each message includes a timestamp for better context
- Color-Coded Interface: Clean, readable UI with color-coded elements
- Zero External Dependencies: Uses only
ncat(part of the nmap package) - Cross-Platform: Works on any Linux distribution with Bash
- Linux-based operating system (tested on Garuda Linux / Arch Linux)
- Bash shell
ncatutility (from the nmap package)
git clone https://github.com/codev-aryan/termichat.git
cd termichatsudo pacman -S nmapsudo apt install ncatsudo dnf install nmap-ncatchmod +x termichat.sh-
Run the script:
./termichat.sh
-
Select option
1(Server) -
Enter a port number (default: 12345)
-
The server will display your local IP address and start listening for connections
-
Share your IP address and port with clients who want to join
-
Run the script:
./termichat.sh
-
Select option
2(Client) -
Enter the server IP address
-
Enter the server port (default: 12345)
-
Enter your username
-
Start chatting!
Server:
$ ./termichat.sh
Select Mode:
1) Server (Host the Chat Room)
2) Client (Join a Chat Room)
Enter choice [1 or 2]: 1
Enter Port to listen on (default 12345): 12345
Server listening on IP: 192.168.1.100
Server listening on Port: 12345
Waiting for clients to connect...
Client:
$ ./termichat.sh
Select Mode:
1) Server (Host the Chat Room)
2) Client (Join a Chat Room)
Enter choice [1 or 2]: 2
Enter Server IP: 192.168.1.100
Enter Server Port (default 12345): 12345
Enter your Username: Alice
Connected to chat as [Alice]
Type a message and press Enter to send.
------------------------------------------------
[14:32] [Alice]: Hello everyone!
TermiChat uses ncat in broker mode to create a multi-user chat hub:
- Server Mode: Runs
ncatwith the--brokerflag, which acts as a message relay between all connected clients - Client Mode: Connects to the server and formats outgoing messages with timestamps and usernames
- Message Format:
[HH:MM] [Username]: Message
- Local Network: Works out of the box on the same LAN
- External Access: To allow connections from outside your network, configure port forwarding on your router
- Firewall: Ensure the chosen port is open in your firewall:
sudo ufw allow 12345/tcp # For UFW users
- No message encryption (plaintext over network)
- No message history or logging
- No authentication system
- Limited to IPv4 addresses
- Requires manual IP address sharing
Install the nmap package using your distribution's package manager.
- Verify the server is running
- Check that the IP address and port are correct
- Ensure no firewall is blocking the connection
- Confirm both devices are on the same network
- Check network connectivity between server and client
- Verify the correct port is being used
- Try restarting both server and client
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
This project is open source and available under the MIT License.
Created by codev-aryan
- Built with
ncatfrom the Nmap Project - Inspired by classic IRC chat systems