Webserv light in c++ 98 with epoll
redirection and new constructor for cgi
/*
+----------------------------------------------------------------------------------------------------------------+
| |
| class Containers |
| |
| |
| _binding |
| +----------------------------+----------------------------+----------------------------------------------+ |
| | | | | |
| | +--------------------+ | +--------------------+ | +--------------------+ | |
| | | | | | | | | | | |
| | | hostname, port | | | hostname, port | | | hostname, port | | |
| | | | | | | | | | | |
| | +--------------------+ | +--------------------+ | +--------------------+ ... ..... .... | |
| | | | | | | | | | | |
| | | class *socket | | | class *socket | | | class *socket | | |
| | | | | | | | | | | |
| | +---------+----------+ | +--------------------+ | +--------------------+ | |
| | | | | | |
| +-------------+--------------+----------------------------+----------------------------------------------+ |
| | |
| | |
+-----------------+----------------------------------------------------------------------------------------------+
|
| +-------------------+
+-------------v-------------+ struct to event | |
| | +--------------------+ | |
| class Socket | | | | |
| <---------+ | int fd | | +-------------v--------------+
| _socketfd | | | | | | |
| | | +--------------------+ | | +--------------------+ |
+-------------+-------------+ | | | | | | | |
| +--------+ clas *socket | | | | location | |
+--------------v-------------+ | | | | | | |
| | +--------------------+ | | +--------------------+ |
| +--------------------+ | | | | | |
| | | | | | | engine | |
| | servername | | | | | | |
| | | | class Server | | +--------------------+ |
| +--------------------+ | +----------------------+ | | |
| | | | | | | +----------------------------+
| | class *server +---+----------------->| | | | |
| | | | | | | | +--------------------+ |
| +--------------------+ | | | | | | | |
| | | | | | | location | |
+----------------------------+ | | | | | | |
| | | | | | +--------------------+ |
| +--------------------+ | | +----------------+ | | | | | |
| | | | | | | | | | | engine | |
| | servername | | | | array route +--+------+ | | | |
| | | | | | | | | +--------------------+ |
| +--------------------+ | | +----------------+ | | |
| | | | | | +----------------------------+
| | class *server | | +----------------------+ | |
| | | | | |
| +--------------------+ | | |
| | | |
+----------------------------+ | |
| | | ............. |
| | | |
| | | |
| | | |
| | | |
| ............. | | |
| | +----------------------------+
| |
| |
| |
| |
+----------------------------+
*/
How to build a simple HTTP server
HTTP/1.1 : Message Syntax and Routing (RFC 7230)
HTTP/1.1 : Semantics and Content (RFC 7231)
HTTP/1.1 : Conditional Requests (RFC 7232)
HTTP/1.1 : Range Requests (RFC 7233)
HTTP/1.1 : Authentication (RFC 7235)
HTTP/2 : Header Compression (RFC 7241)
https://jkorpela.fi/forms/cgic.html#simpleform http://sdz.tdct.org/sdz/ecrivez-votre-site-web-en-c-avec-la-cgi.html