Skip to content

OzAmoyal/HTTP-Server-Using-TCP-Sockets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Implementation of server code code which acts similar to HTTP server!

IntroductionImplementationVisualization & ScreenshotsInstallationAuthor

Introduction

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.

Implementation

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.

Visualization & Screenshots

Visualization



Screenshots

Installation - How To Run Code

  1. 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-Sockets
    

    Alternatively, you can just download all the files from this repo to your computer, and save them all in that specific folder

  2. Open “terminal” in this specific folder.

  3. 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.


  1. Open any browser you want: Google Chrome, FireFox, Edge, Safari, etc.

  2. write in the search bar (url) the following format:

    http://[Server IP]:[Server port][Path]
    

and enter the server IP, Port, and path accordingly.

  1. Press enter and enjoy the results.

Built With

  • Python
  • TCP Sockets

Author

Oz Amoyal

About

Implement the HTTP protocol to launch a server that sends a requested file or a page to the browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published