Skip to content

magnitopic/webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webserv

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.

webserv-example

Team work 💪

This project was done alongside Javier Sarabia(JaviBurn). Check him and his work out at these links:

Program

Initial installation and compilation

git clone https://github.com/magnitopic/webserv.git
cd webserv
make

Execution

The program take's a configuration file as argument. If none is provided the default configuration file is ./webserv.conf.

./webserv [config_file]

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

Stress test

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

Open ports

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 and 8082. You can add your own ports to the script.

./open_ports.sh

Pages directory

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.