0xOnyx / 42_webserv

Webserv light in c++ 98 with epoll
MIT License
0 stars 0 forks source link

42_webserv

Webserv light in c++ 98 with epoll

redirection and new constructor for cgi

CLASS

/*
+----------------------------------------------------------------------------------------------------------------+
|                                                                                                                |
|                                             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    |   |                  +----------------------+            |                            |
|   |                    |   |                                                      |                            |
|   +--------------------+   |                                                      |                            |
|                            |                                                      |                            |
+----------------------------+                                                      |                            |
|                            |                                                      |      .............         |
|                            |                                                      |                            |
|                            |                                                      |                            |
|                            |                                                      |                            |
|                            |                                                      |                            |
|      .............         |                                                      |                            |
|                            |                                                      +----------------------------+
|                            |
|                            |
|                            |
|                            |
+----------------------------+
*/

Resources

Server setup

How to build a simple HTTP server

Simple server with C++

C++ Web Programming

HTTP 1.1 (standard to follow) :

HTTP/1.1 (RFC 2616)

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 : Caching (RFC 7234)

HTTP/1.1 : Authentication (RFC 7235)

Other HTTP (legacy / future) :

HTTP/1.0 (RFC 1945)

HTTP/2 (RFC 7240)

HTTP/2 : Header Compression (RFC 7241)

FTP (RFC 959)

HTTP Header Syntax

HTTP Request Methods

HTTP Status Codes

HTTP Header Break Style

Select and non-blocking

Select

Non-blocking I/O

CGI

CGI : Getting Started

CGI 1.1 Documentation

https://jkorpela.fi/forms/cgic.html#simpleform http://sdz.tdct.org/sdz/ecrivez-votre-site-web-en-c-avec-la-cgi.html