A simple HTTP server implementation in C
Caution
Make sure to have libmagic
installed on your system before building the project.
simple-http [-c <config file>] [-d <directory>] [-h <host>] [-p <port>] [-t <timeout]
By default, the server listens on host
0.0.0.0
port80
and serves files from./www
If no arguments are provided, the server will try to load
/usr/local/etc/simple-http.conf
or/etc/simple-http.conf
if the former does not exist.
-c <config>
: Path to configuration file (will ignore other options)-d <directory>
: Directory to serve files from (default:./www
)-h <host>
: Host to listen on (default:0.0.0.0
)-p <port>
: Port to listen on (default:80
)-t <timeout>
: Timeout in milliseconds (default:0
, no timeout)
First, install the required dependencies:
# Debian/Ubuntu
sudo apt-get install libmagic-dev
On other systems, you may need to install
libmagic-devel
orfile-devel
instead. Please refer to your package manager's documentation.
Then, build the project:
make
This project is licensed under the MIT License. See LICENCE