This project is a command-line chat application using TCP sockets. It enables real-time messaging between a client and a server over a network. It supports UTF-8 encrypted communication and includes hostname identification for a better chat experience.
✅ Simple and lightweight TCP-based chat system
✅ Supports remote messaging over a network
✅ Displays client hostname for better tracking
✅ Uses UTF-8 encoding for message transfer
✅ Multi-threaded server for handling multiple clients
✅ Color-coded output for better readability 🎨
- Python 3.x
socket,threading,argparse(Built-in Python modules)coloramaandpyfiglet(Install usingpipif not available)
Run the following command on the machine acting as the server:
python server.py <host_ip> <port>Example:
python server.py 127.0.0.1 8080🔹 Replace <host_ip> with your local or public IP address.
🔹 Replace <port> with an available port (e.g., 8080).
Run the following command on another machine (or the same device) acting as the client:
python client.py <server_ip> <port>Example:
python client.py 127.0.0.1 8080🔹 <server_ip> should match the server's IP.
🔹 <port> should match the server’s listening port.
✅ Type a message and press Enter to send it.
✅ Messages from the other side will appear in the terminal.
✅ To exit, type:
exit- If running both server & client on the same device, use
127.0.0.1(localhost) as the IP. - To allow external devices to connect, use your actual network IP (
ipconfigon Windows,ifconfigon Linux/macOS). - Ensure the port is open in your firewall if running over a network.
This project is for educational and ethical use only. Unauthorized use of this script on systems without permission is illegal.
🔹 Author: ARUVASAGA CHITHAN
📌 GitHub: AruvasagaChithan