A minimalist Python socket implementation demonstrating real-time chat capabilities between multiple clients through terminal interfaces.
- TCP Socket Communication - Basic server-client architecture using Python's built-in socket library
- Multi-Client Support - Handle multiple concurrent connections
- Educational Focus - Clean code structure ideal for learning network fundamentals
- Cross-Platform - Works on any OS with Python 3.x
git clone https://github.com/irhdab/pysocketchat.git
cd pysocketchat
No external dependencies required beyond Python standard libraries
Start Server:
python server.py
# Default port: 5555 (modify in code if needed)
Connect Clients:
python client.py
# Enter IP: 127.0.0.1 in default
pysocketchat/
├── server.py # Socket server implementation
├── client.py # Client connection handler
└── README.md # Documentation
Server initialization:
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('localhost', 12345))
server.listen()
Client message handling:
while True:
message = input("You: ")
client.send(message.encode('utf-8'))
This project uses only Python's built-in libraries, such as socket and threading. No additional dependencies are required, as long as you have Python 3 installed.
- Fork repository
- Create feature branch (
git checkout -b enhance/feature) - Test changes locally
- Submit pull request