BlueHawk 1.0 HTTP Server
BlueHawk is an HTTP/1.1 compliant web server.
📝
Table of Contents
🔷
About
This project is done as a part of Computer Networks course. It aims at the implementation of the HTTP/1.1 Protocol based on RFC 2616 and includes the basic HTTP methods of GET
, POST
, PUT
, DELETE
and HEAD
.
Prerequisites
- Python 3.x
For installing necessary dependencies run the following command:
$ pip3 install -r dependencies.txt
🔷
Usage
Follow the given steps to run the server
$ cd src
$ bash bluehawk.sh
This will run the server on a default port defined in the config.py file. You can customize the configuration by editing the config file in the src/ directory. Options available in the config file are:
DOCUMENT_ROOT
: The document root directory of the server that will serve the requestsTIMEOUT
: The Timeout value for the responsePORT
: The port on which the server will listenMAX_CONNECTIONS
: The maximum number of parallel connections that the server should serveKEEP_ALIVE
: Time for which a connection is to be kept alive
To stop the server press Ctrl-C
To get more information about the server, run the bluehawk.sh
file with -i
option
$ cd src
$ bash bluehawk.sh -i
🔷
Testing the server
A script file test.sh
will perform automated testing of the server for all implemented methods and status codes along with multithreading. It will save the expected response along with received response in results.txt
file. You can browse through the file to understand the differences if there are any.
For testing, run the following command in a new terminal window (Note: Make sure that the server is up and running in another window)
$ bash test.sh
It will take a minute to complete all the tests (Note: Some test cases might fail because of If-Match
and If-Modified
headers as those values are changed when you clone the repo)