A simple multi-user chat system built with Python TCP sockets and threads. No external libraries required.
| File | Purpose |
|---|---|
server.py |
Accepts connections, manages nicknames/channels, routes messages |
client.py |
Connects to the server, sends and receives messages |
- Python 3.x (standard library only)
1. Start the server
python server.py2. Start one or more clients (each in its own terminal)
python client.pyEnter the server IP, port (12345 by default), and a nickname when prompted.
| Command | Description |
|---|---|
/nick <name> |
Set or change your nickname |
/join <channel> |
Join a channel |
/msg <nick> <text> |
Send a private message |
/quit |
Disconnect from the server |
Typing anything without a / sends a message to your current channel.
/nick Hamid
/join general
Hello everyone!
/msg John Hey, this is private
/quit
- Multiple simultaneous clients via thread-per-client
- Named channels with broadcast messaging
- Private messages between users
- Graceful disconnect and crash recovery
- Server-side logging for transparency