Skip to content

Sleleu/webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

188 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webserv

Project

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 :

Server_process

Final render

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 :

render_shell

For a server initialized on port 8080, for example, by going to http://localhost:8080, a presentation page will be available :

webserv_site

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" :

client

Installation

Clone the repository and make

git clone git@github.com:Sleleu/webserv.git
cd webserv
make

If you want to install client

From ./webserv :

cd src/client
make

Usage

Here is a standard use of the program :

./webserv serv.conf

You 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

About

Writing an HTTP server in C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors