Introduction • Implementation • Visualization & Screenshots • Installation • Author
This server code is the product of Computer-Networks course assignment, which I took in the 1st semester of my 2nd year at BIU university.
I implemeted an HTTP server on top of TCP, which handles requests from client's browsers to see specific files that sits on the server folder.
After request from client & handling from server is complete, the client can see the result in his browser.
💥 Client request to see specific file like HTML, JPG, etc. using his browser.
💥 Server handles the request from the client.
💥 The client can see the result on his browser' screen.
In the folder of the repository, there is a server code and a files folder. The server functions as a file storage HTTP server which allows clients to coonect, and request files that are inside the files folder.
The files folder contains html pages, jpg photos, etc.
If a client requests a file that in not in the files folder, HTTP 404 error will occur.
After running the server code on the terminal with argument that will be the port server, client can connect with this server,
and ask for pages and files
that are inside the files folder and they will see it in their browser.
-
Clone this repo by creating a specific folder in your computer, open terminal in this folder and run this command:
git clone https://github.com/OzAmoyal/HTTP-Server-Using-TCP-SocketsAlternatively, you can just download all the files from this repo to your computer, and save them all in that specific folder
-
Open “terminal” in this specific folder.
-
Run this command in one terminal to run the server code:
python3 server.py (para1)where para1 = port number that the server will listen to.
-
Open any browser you want: Google Chrome, FireFox, Edge, Safari, etc.
-
write in the search bar (url) the following format:
http://[Server IP]:[Server port][Path]
and enter the server IP, Port, and path accordingly.
- Press enter and enjoy the results.
- Python
- TCP Sockets
Oz Amoyal



