Multi-client socket server & encrypted chat toolkit
TCP-Playground
TCP-Playground is a networking and protocol security toolkit implemented in Python for exploring client-server socket communication, message broadcasting, and transport encryption. It includes a multi-threaded host server (host.py), a chat client (clint.py), and a shared networking utility library (net_utils.py). The system operates in two distinct modes: standard plaintext TCP for inspection and educational debugging, and an encrypted secure mode featuring TLS transport handshakes, certificate verification controls (custom CA trust and insecure testing bypass), client authentication passwords, and application-layer payload encryption.

Problem
Learning socket programming and encrypted client-server protocol design often involves either complex enterprise frameworks or fragile toy scripts lacking authentication, proper TLS wrapping, and testable network boundaries.
Solution
A clear, modular socket architecture pairing multi-client broadcast routing with optional TLS wrapping, self-signed certificate generation guides, application-layer payload encryption, and automated unit tests.
Outcome
A practical socket programming and network security learning lab demonstrating Python socket programming, threading, TLS handshake configuration, and protocol testing patterns.
Standout Features
- Multi-client TCP socket server with concurrent connection handling and live client counters
- Dual operation modes: Plaintext TCP for protocol inspection and TLS + password-encrypted chat
- Robust TLS certificate validation options: strict verify, custom CA trust (--cert), and insecure testing modes
- Shared network utilities library (net_utils.py) with automated pytest suites and CI validation
Stack & Signals
- Python 3.9+
- Sockets
- SSL/TLS
- Threading
- Pytest
- GitHub Actions
Canonical destination