/Simple-Http-Server

Simple Http server for serving static files.

Primary LanguageC++Apache License 2.0Apache-2.0

Shttps - Simple HTTP/1.1 server (It has nothing to do with https or shttp protocol)

About:
It is very simple HTTP server which can be used to serve static files (that is .html files or some blob's).
It supports 2 methods:
- GET
- HEAD
The POST method is not supported because it would serve no purpose due to lack of integration with php or any other backend technology.

For now server can respond with few error codes which are are:
- 200 OK
- 400 Bad Request
- 404 Not Found
- 405 Method Not Allowed
- 500 Internal Server Error
- 505 HTTP Version Not Supported

1. Requirements:
- cmake 
- g++ with c++17 support
- glog
- gflags

2. Build:
- git clone https://github.com/qqwertyui/Simple-Http-Server.git && cd Simple-Http-Server
- mkdir build && cd build
- cmake .. && make

3. Usage:
(Example usage is shown in example.sh)
Possible switches are:
- document_root <path> - path which will server as a document root (base directory for your files) [default=./]
- port <number> - port on which server will work [default=80]
- interface <iface> - interface on which server will be exposed (e.g. lo, eth0, wlan0) [default=all]
- timeout <number> - number of seconds which server will wait in case of client inactivity
- v <0-3> - logging verbosity
- logtostderr <0/1> - if you would like to see messages live on screen instead of logging them to file set this flag to 1
- log_dir <path> - path where logs will be saved