Write own implementation of web server like nginx one with next capabilities:
- custom configs
- multiple servers handling at one or different
ip:port
pairs - multiple client-server connections
- simple CGI
- multiple routes in server, error pages, redirects and max client body size paramets
GET
,POST
andDELETE
methods withHTTP/1.1
version of requests
Language: C++98
- Structured code with object-oriented principles splitted by 5 parts:
- Config
- Core
- Http
- CGI
- Utils
- Custom configs with multiple servers with next parameters:
- ip and port
- server_name
- max client body size
- locations:
- uri
- root
- index
- autoindex
- allowed methods
- cgi
- redirect
- Multiple servers at one or different ip:port socket
- Multiplexing with low-level
select
function for non-blocking sockets problem-solving GET
,POST
andDELETE
methods- Autoindex pages
- Execution of simple CGI bash scripts or binaries
- Simple thread-unsafety logger to console and file
Webserv.mp4
PP189B | Uliana-So | AliceFromWardenfell |
---|---|---|
HTTP + requests processing + default pages | Config + CGI + Kvast website | Client-server connections, multiplexing and etc. |
-
Kvast website at
http://kvast.webserv.local
Use this template for adding new server:
server
ip <...>
port <...>
server_name <name1> <name2> <name3>
max_body_size <number in bytes>
location <uri>
root <...>
index <...>
cgi <...>
redirect <...>
method <m1> <m2> <m3>
autoindex <on/off>
location <uri>
...
make
./webserver [path_to_config]