This project is about writing an HTTP server in c++98.
The project was carried out in 3 main areas:
- Parsing a configuration file allowing the instantiation of multiple servers
- Creation of a server receiving HTTP requests from clients, and returning the appropriate response
- Parsing each request and building the response and return code
The instantiation of the handler and its servers is done in the following way :
Once the program is launched, the terminal displays some information such as the initialization of the servers with their names, ports, as well as the incoming requests and responses sent on each socket :
For a server initialized on port 8080, for example, by going to http://localhost:8080, a presentation page will be available :
The presentation page contains routes to tests of our CGIs such as :
- The use of a calculator
- The execution of php and python scripts
as well as for the use of text file upload and file deletion in order to test more easily the implementation of the POST and DELETE methods. The page finally provides an access to the bible.txt in order to test the display of large pages
To test the server further upstream, a simple client has been created and is accessible from the path ./src/client. Here is an example of its use after installation, by launching an invalid HTTP GET request "/hellooo" :
git clone git@github.com:Sleleu/webserv.git
cd webserv
makeFrom ./webserv :
cd src/client
makeHere is a standard use of the program :
./webserv serv.confYou can modify the serv.conf file to add other parameters or servers.
Eventually, see with the option --verbose for more parameters about parsing of the request/response



