Example http server, providing static file hosting.
See the project page (himsel.me/toy-http)
- support for GET and HEAD requests (you can implement other methods easily)
- stable error and interruption management
- scalable and easy to modify
- fast file serving
- blocking function for parental folders of the serve folder
- less than 500 lines of source code
- download from github.
- check the dependencies
- open a terminal and
cdinto the repository
- and then
sudo make install
toy-http into a terminal!
no dependencies to external libraries, just the C standard libraries and
the posix API (preinstalled on all good unix-derivates) and socket api (included)
preferred C compilers:
- Mac OS
- FreeBSD, OpenBSD, NetBSD, DragonflyBSD
- GNU Hurd
- Solaris (maybe)
- and more, every other OS with POSIX and C libraries
- Windows is supported with an environment like CygWin (or something similar)
This project is licensed under the GNU AGPL v3 or later.
Copyright (C) 2015, 2016 Lukas Himsel