Socket Messenger is a simple client–server messaging application written in Python using low-level sockets.
- Multiple clients can connect to a central server
- Authentication using usernames and passwords
- Persistency via a text file
- Direct client-to-client messaging (no broadcast)
- Concurrent connections handled via threading
- Python (
socket,threading,os,dotenv) - Docker & Docker Compose
- Linux-based containers (Ubuntu / official Python images)
- Docker Desktop (required docker engine to enable containerization)
- WSL2 (required on Windows to provide Linux kernel)
This method automatically builds images and starts the server and clients.
- clone the repository:
git clone https://github.com/YehorSolonukha/socket_messenger
cd socket_messenger
- start Docker Desktop
- after Docker Desktop is fully running, execute:
.\windows_docker_setup.ps1
This method provides full control over container configuration.
- verify Docker installation
- Open a new terminal and run:
docker run hello-world
- If Docker is set up correctly, you should see a confirmation message and the container will exit automatically.
- clone the repository:
git clone https://github.com/YehorSolonukha/socket_messenger
cd socket_messenger
- manually remove the last line in compose.yaml - "command: sleep infinity"
- build Docker images
docker compose build
This builds both the server and client images using their respective Dockerfiles.
You can verify that the server is running with docker compose ps
5. open a new terminal for the first client and start a client container
docker compose run --it client
- open a new terminal for the second client and start a client container
docker compose run --it client