Skip to content

goffauxs/webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webserv

42 Project - Webserv

About

This project is a NGINX-like HTTP Web server written in C++.

How it works

It is built upon Berkeley Sockets using a socket(), bind(), listen() workflow to wait for new client connections, accept() to establish a new socket with each client, and select() to suspend while waiting for the client sockets to be ready to be read from or written to. We then use the result of select() to recv() (receive) a request from the client or send() a response to the client.

The server is able to accept GET, POST, and DELETE requests. There is a working CGI that is able to handle GET and POST requests, either with query parameters, or in the case of POST with the content in the body of the request. As an example, the server can run Perl and Pyton CGI scripts, with some examples in cgi-bin.

Configuration

The configuration of the server is done using a .conf file as a parameter to the program. This configuration file is very similar in format to that of NGINX, using the same or similar directives. An example configuration can be found here, containing at least one example of each possible directive.

Installation

Compiled using make all

About

42 Project - Webserv

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •