A project made in accordance with the Webserv project which is part of the Codam Core Curriculum. This project was a collaboration between with Marès Verbrugge, Flen Huisman and Felicia Koolhoven. We created our own HTTP server in C++, following HTTP 1.1 and taking nginx as an example. HTTP is one of the most used protocols on the internet. We tested our webserv in a browser (Firefox).
Start by cloning the repository:
git clone https://github.com/maresverbrugge/webserv.git
Go into the minishell directory and compile by using make:
make
Webserv takes as input a configuration file, similar to an nginx configuration file. It contains directives such as host (e.g. localhost), port (e.g. 8080) and route (e.g. /pages). See the config folder for examples or read the subject to find the configuration file requirements. To use our default configuration:
./webserv config/default.conf
You can then make requests through the browser. For example:
http://localhost:8081/
You can find all the requirement we had to meet in the subject. Our webserv:
- Is compatible with at least Mozilla Firefox
- Can serve a fully static website
- Handles GET, POST and DELETE requests
- Uses epoll to efficiently monitor all sockets / file descriptors
- Will provide accurate HTTP response status codes and error pages
- Allows you to upload and delete files on specified locations
- Can execute CGI, for example to generate an HTML page through a Python script
This was the first group project we did in C++. We spent about 2.5 months on it and passed it with bonus points! We gained knowledge on:
- Object-oriented programming, designing classes
- I/O multiplexing using epoll
- HTTP requests and responses
- The inner workings of webservers
- Writing reliable parsers in C++
- Using Git and GitHub in a collaborative way
- Concurrent programming (to handle CGI)
- Modern C++ and smart pointers
- HTML, CSS and JavaScript (for our test web pages)
- Python (for our CGI scripts)
See our profile pages for ways to contact us!