This project is about writing your own HTTP server.
Being able to understand how the HTTP protocol works is a fundamental skill for web developers. This project will help you understand what happens when you type an address into your browser and press enter.
This project was done alongside Javier Sarabia
(JaviBurn).
Check him and his work out at these links:
git clone https://github.com/magnitopic/webserv.git
cd webserv
make
The program take's a configuration file as argument. If none is provided the default configuration file is ./webserv.conf
.
./webserv [config_file]
The configuration file is a simple text file that contains the server's configuration. It's composed of a series of blocks, each one representing a server. Each block is composed of a series of directives.
Example configuration files can be found in the root of the repository.
You can test the servers performance by running the siege
command. This command will send a series of requests to test the server's performance.
siege -b http://localhost:8080
The server will open a socket for every port specified in the configuration file.
You can check it has opened the ports by running the example script open_ports.sh
:
NOTE: This script checks ports
8080
and8082
. You can add your own ports to the script.
./open_ports.sh
The pages directory of the repository contains example pages that can be accessed by the server. You can add your own pages to this directory and access them through the server.