Mamey 📖 |
Heralex 📖 |
SergioRamirez 📖 |
This is an university project for a Client-Server architecture, using TCP sockets, threading, md5-hash encryption, docker containers and docker networking.
- There are 2 servers, that can access a database.
- There are clients that can request to sign up, register, identity verification, and encryption of messages to these servers.
- All the connections happen through a "proxy" server, that handle all clients connections to the 2 servers.
An explanation of the architecture of this program would be the following UML (in spanish):
- Python 3.10
- pycryptodome 3.18.0
- Docker
- Poetry (For dependency and venv management on the IDE)
If you dont want to use poetry, you would need to install all the dependencies in the
pyproject.toml
manually with pip install
- Download the project and enter its directory.
- Run pip install poetry
- Run poetry install
- Once poetry creates the virtual environment from the
pyproject.toml
add it as an interpreter for your IDE.
Once you have everything set up and the project installed to run the project you need to execute these files in order:
servidor_A.py
andservidor_B.py
proxy.py
client.py
Execution order is important, otherwise the sockets of each file wont communicate.
Step 1: Create each image with the following terminal commands:
cd cliente
sudo docker build -t imagen_cliente .
cd servidores
sudo docker build -t imagen_servidores .
cd proxy
sudo docker build -t imagen_proxy .
Step 2: create a docker network:
docker network create red_sergio_hernani_victor
Step 3: Create the containers with the images and the network
sudo docker run --name contenedor_servidores --network red_sergio_hernani_victor -d imagen_servidores
sudo docker run --name contenedor_proxy --network red_sergio_hernani_victor -p 127.0.0.1:6000:6000 -d imagen_proxy
sudo docker run -it --name contenedor_cliente --network red_sergio_hernani_victor imagen_cliente
With all the previous steps completed you can should be able to interact with the container with the client.
Extra commands:
sudo docker exec -it <guid> bash
Runs existing container.poetry shell
runs the shell of the venvdocker logs container_name
opens de the logdocker start [OPTIONS] CONTAINER [CONTAINER...]
Start on or more stopped container
Read the LICENSE
for more info,