Graeme's

Dandelion web server

Posted by Graeme in at 6:32 pm on Wednesday, 3 December 2008

This is a simple and lightweight single source file pure TCL webserver, that can easily be embedded. Dandelion because it is bigger than Dustmote (the smallest TCL web server) but still small and light.

GPL licensed. Download from here (bz2) or here (zip). Please send me comments, criticism or any other feedback, or just to let me know that you use it.

The download contains another file with code extracted from ncgi plus two small procs of my own to deal with form data and cookies.

The documentation is in the source file. An HTML version of the source (generated by Simpledoc) is provided in the download archive to make it more readable. This may not sound friendly, but the first part of the source file is just documentation, and it should be easy to get going.

Requests are parsed, checked and passed to handler. The simple static_handler and simple_handler are provided as a examples.

The handler mostly receives the same as CGI variables in $headers dict. A major exception is that REQUEST_URI has had query string and fragment removed and been url decoded. Some other things are missing. Please see the output of simple_handler to see what is there.

The handler should include a “Connection: Close” header as keep alive is not supported. This is done by try_file and the example handler, and looking up the beginning of the response in ::dandelion::first_line is sufficient to ensure this.

Features:

Limitations:

Please let me know if you use Dandelion.

Comments disabled

Sorry, comments are closed