This project is a multithreaded TCP file server. A file server is any type of server that recives requests and serves files. Multithreading has been used to ensure multiple clients can connect at the same time. Good coding practices have been adhered to.
This Project tries to mimic some of nginx/apache functionality, but it is too "simple" for it to do so. It also tries to use HTTP-like syntax to communicate between server and client
It is preferable to use Linux OS for running this project
- First, initialize a new virtualenv by running
python -m venv lab_env - in the terminal, run
activateif you are onpowershell- If you are on
bash/zsh,cd lab_env, then runsource bin/activate
- If you are on
- run
pip install -r requirements.txt - if you are on linux, give the run script proper permissions by running
chmod 777 run.py- If you are on windows, execute the script in an with admin privileges and allow firewall bypass
- To run the TCP server, execute
python run.py server - To run the TCP client, execute
python run.py client
It should be noted that
internal/fileshouses the files served by the server, whileinternal/client_fileshouses the files requested by the client
socketfor TCP socket utilitiessubprocessfor executing processesosfor file and dir manipulationsysfor handling system events gracefullyjsonfor data serialization across socketsrichfor good terminal UI