Skip to content

Tooo/Web-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Server

Simple web server that handles one HTTP request at a time. Handles the messages for 200, 304, 400, 404, and 408. A multi-threaded web server is also avaliable to handle multiple requests simultaneously

Installation

  1. Download and install Python 3.9.
  2. Git clone this repo
https://github.com/Tooo/Web-Server.git

Single-Threaded Web Server

  1. In webserver.py, fill in your server's host and port.
SERVER_HOST = '0.0.0.0'
SERVER_PORT = 8080
  1. Run webserver.py.
python3 webserver.py
  1. Open the URL on your browser with your server's host and port.
<SERVER_HOST>:<SERVER_PORT>

Multi-Threaded Web Server

  1. In multi_webserver.py, fill in your server's host and port.
SERVER_HOST = '0.0.0.0'
SERVER_PORT = 8080
  1. Run multi_webserver.py.
python3 multi_webserver.py
  1. Open the URL on your browser with your server's host and port.
<SERVER_HOST>:<SERVER_PORT>

Supported HTTP Response Status Codes

Code Message
200 OK
304 Not Modified
400 Bad Request
404 Not Found
408 Request Timed Out

Testing

Multi-Thread Web-Server

  1. Install python package requests.
pip install requests
  1. Run multi_webserver.py
python3 multi_webserver.py
  1. Run test_multithreaded.py located in the tests directory
python3 test_multithreaded.py

About

Simple Web Server: Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •