[BusyBox] httpd contrib

Glenn Engel at Home glenne at engel.org
Mon Sep 2 22:40:04 UTC 2002


Attached are patches to busybox and networking/httpd.c for a minimal busybox implementation of httpd.  It adds about 6k to busybox with all features and is about 10k standalone.  Features include support for ip allow lists, basic authentication by url prefix, cgi scripts, assist for cgi url decode/encode, and precharging env variables with form values.

Quoting the header comments:

 * Typical usage:
 *   cd /var/www
 *   httpd
 * This is equivalent to
 *    cd /var/www
 *    httpd -p 80 -c /etc/httpd.conf -r "Web Server Authentication"
 *
 * When a url contains "cgi-bin" it is assumed to be a cgi script.  The
 * server changes directory to the location of the script and executes it
 * after setting QUERY_STRING and other environment variables.  If url args
 * are included in the url or as a post, the args are placed into decoded
 * environment variables.  e.g. /cgi-bin/setup?foo=Hello%20World  will set
 * the $CGI_foo environment variable to "Hello World".
 *
 * The server can also be invoked as a url arg decoder and html text encoder
 * as follows:
 *  foo=`httpd -d $foo`           # decode "Hello%20World" as "Hello World"
 *  bar=`httpd -e "<Hello World>"`  # encode as "&#60Hello&#32World&#62"
 *
 * httpd.conf has the following format:
 * ip:10.10.         # Allow any address that begins with 10.10.
 * ip:172.20.        # Allow 172.20.x.x
 * /cgi-bin:foo:bar  # Require user foo, pwd bar on urls starting with /cgi-bin
 * /:foo:bar         # Require user foo, pwd bar on urls starting with /
 *
 * To open up the server:
 * ip:*              # Allow any IP address
 * /:*               # no password required for urls starting with / (all)
 *
 * Processing of the file stops on the first sucessful match.  If the file
 * is not found, the server is assumed to be wide open.

Enjoy !

--
Glenn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20020902/a1aaa159/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httpd.patch
Type: application/octet-stream
Size: 3121 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20020902/a1aaa159/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httpd.c
Type: application/octet-stream
Size: 36482 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20020902/a1aaa159/attachment-0001.obj 


More information about the busybox mailing list