ohio, a minimalistic web server
ohio is a fast'n'dirty 2 days project written in C that implements
a GET HTTP/1.0 web server. It is small but does not require inetd.
352 lines of code
ohio is probably the smallest web server written in C.
This is currently made of 352 lines of C with comments.
Currently it just works nice for lan document sharing.
- no config file
- auto daemonizing
- ".." and "%2E%2E" protection
- GET only accepted
- can bind any TCP port
- no config file, all in command line
- compiles also with dietlibc
You can learn C by reading the source code of ohio
and imagine improvements from your own.
- does not yet url-encode local filenames (FIXME)
- does not interpret ? or # in URL
- does not handle correctly named pipes or devices
- does not change its UID on serving files (FIXME)
- does not chroot to DocumentRoot(FIXME)
ohio is free software, released under the WTF Public License v2.0.
(see license in the tarball). Enjoy and stretch the toy :
Dec 2008 -- Ben
Nov 2008 -- Ben
May 2007 -- Ben