Jay13Jeong / soo-je-webserver

Handmade webserver made of CPP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handmade webserver "Soo-Je"

Handmade webserver made of CPP.

This server acts as a single thread for all but cgi.

This webserver was created by referring to NGINX.


d2

Usage

This program can receive a single arg, and if there is no arg, it runs "default.conf" by default.
The setup of the conf file is based on nginx.
Then connect to the browser with the open port printed on the terminal (Enter "localhost:8011")

Method Support

GET, HEAD, POST, PUT, DELETE

Conf file setting

listen : Specify a port.
host : Specify a host.
server_name : Specify server name.
root : Directory on the server that connects to URI.
index : Default files in the corresponding URI directory.
cgi : The extension of the cgi to use and the location of the launcher. (ex: cgi .py /usr/bin/python3)
default_error_pages : override the error page to display if an error occurs.
location : override the behavior of the server based on the path of URI.
accept_method : Only allowed methods can be handled by the server with the current path.
autoindex : If this option is "on", the 404 page will not pop up, and the list of files in the destination folder will be listed.
client_max_body_size : Maximum acceptable payload size.
return : 301 permanently moved.

Browser Support

This server has been tested in a Chrome environment.
Only HTTP 1.1 is supported.

Reference

https://www.freebsd.org/cgi/man.cgi?kqueue
https://www.rfc-editor.org/rfc/rfc7230
https://www.rfc-editor.org/rfc/rfc7231

Scenes tested with server tester (siege -b test, parrot test)

testtt

a2

About

Handmade webserver made of CPP

License:MIT License


Languages

Language:C++ 90.8%Language:HTML 3.8%Language:Python 3.6%Language:C 1.0%Language:Makefile 0.6%Language:Perl 0.2%