eris

Very small inetd http server
git clone https://git.woozle.org/neale/eris.git

  1About
  2=====
  3
  4Eris is an HTTP/1.1 web server with CGI.
  5It is very fast,
  6uses very little memory,
  7and has a tiny codebase which has been audited at least twice by gray-hat hackers.
  8It relies on an external program,
  9such as tcpserver or netcat,
 10to handle networking,
 11and expects to be run once for every connection.
 12This may sound horrible,
 13but it's actually pretty quick,
 14especially since this architecture makes it trivial to use the
 15`sendfile` call in Linux
 16(added in 2003 as a reaction to Apache losing to IIS in benchmarks),
 17which sends an open file directly to a socket,
 18without having to context switch into userspace.
 19
 20It conforms to the parts of HTTP/1.1 that appear to be important to clients.
 21I have not found any HTTP/1.1 clients which have trouble with Eris,
 22including curl, which breaks with fnord (the reason I began work on Eris).
 23
 24Eris HTTPD is a part of [Dirtbags Capture The Flag](http://dirtbags.net/ctf/).
 25After many patches against [fnord 1.10](http://www.fefe.de/),
 26I decided to fork fnord into a new project.
 27Fnord's author approved of the fork.
 28
 29
 30Differences with fnord
 31======================
 32
 33Significant differences between eris and fnord are:
 34
 35* command-line arguments instead of compile-time defines
 36* eliminated use of libowfat
 37* no build dependency of dietlibc
 38* elimination of "old style symlink handling"
 39* elimination of user switching (you can use tcpserver -[ug])
 40* elimination of chroot code (you can use chroot)
 41* several bugfixes (sent to the fnord mail list)
 42* ignores Accept header (fnord also ignores it, but claims not to)
 43
 44Usage
 45=====
 46
 47Start with:
 48
 49	tcpserver -v -RHl localhost -u 1234 -g 1234 0 80 ./eris
 50
 51There are many other ways to start eris.
 52For example, you can run an HTTPS server with stunnel.
 53
 54You just need something that launches eris with stdin and stdout connected to the client.
 55
 56
 57Logging
 58-------
 59
 60Will log to stderr in the form
 61
 62	127.0.0.1 200 23 localhost Links_(0.96;_Unix) none /index.html
 63
 64where 127.0.0.1 is the client IP, 200 is the HTTP exit code,
 6523 is the size of the content that was served (or 0 for unsuccessful exit codes),
 66localhost is the Host: header (the virtual host),
 67the next token is the user agent with spaces replaced by underscores,
 68the next token (none) is the Referer HTTP header or "none" if none was given,
 69and the rest of each line is the decoded requested URL.
 70
 71
 72Features
 73--------
 74
 75eris does simple virtual hosting.  If the `Host:` HTTP header is there,
 76eris will try to chdir to a directory of that name, i.e. if the client
 77asks for "/" on host "www.fefe.de", eris will look for
 78"www.fefe.de/index.html".  Eris will also try the directory "default"
 79if no specific directory for the virtual host was there.
 80
 81eris implements el-cheapo HTTP ranges (only byte ranges and only of the
 82form x-y, not multiple ranges).
 83
 84eris will change dots at the start of file or directory names to colons
 85in the query before trying to answer them.
 86
 87eris understands and implements keep-alive connections.
 88
 89eris will use sendfile on Linux to enable zero-copy TCP.
 90
 91If eris is given the -c option, it will regard files
 92whose names end with ".cgi" as CGI programs and try to execute them.
 93Please see <http://hoohoo.ncsa.uiuc.edu/cgi/interface.html> for the CGI specification.
 94
 95
 96About The Name
 97==============
 98
 99[Eris](http://en.wikipedia.org/wiki/Eris_%28dwarf_planet%29)
100is the most massive (heaviest) dwarf planet in the solar system.
101It's heavier than Pluto!
102
103Its discovery is what spurred astronomers to finally define the word "planet",
104which resulted in Pluto being classified a dwarf planet.
105Otherwise, we would have to count Eris as a tenth planet.