UNIX sockets, interaction with TCP, HTTP requests parsing, HTTP response building, requests polling, I/O buffers, even-driven and fault-tolerance design, CGI implementation.
Project Name | webserv |
---|---|
Description | A fully configurable home-made web server in C++ (following HTTP/1.1 RFC) |
Technologies |
git clone https://github.com/GSantoine/webserv.git
cd webserv
make
./webserv <CONFIG FILE> (you can use by default the example config file : config_files/default.conf)
You can now access it on your browser on the ip and port specified in the config file you launched the server with
You can configure you server by modifying the config file it runs with (config files structure and rules are very much inspired by Nginx)
Here is an example of a config file :
server {
listen: 127.0.0.1:8080
server_name:example.com
client_max_body_size : 1000000
index: index.html
error_page: 404 /error_pages/404.html
root : html
allowed_methods: GET POST
location /assets/ {
autoindex:on
}
location /error_pages/ {
autoindex:on
root:html_test_root
}
location /test {
rewrite: 302 /
}
location /assets/uploaded_files/totoro.jpg {
allowed_methods: DELETE
}
}
server {
listen: 127.0.0.1:8081
server_name:agras.com
root: html_test_root
index:index.html
}
server {
listen: 127.0.0.1:8081
server_name:agras.com
index:index.html
}
server {
listen: 127.0.0.1:8082
server_name:agras.com
autoindex:on
}