[gopher] My toy gopher server

Alan Plum alan.plum at uni-koeln.de
Tue Nov 3 08:06:33 UTC 2009


Hello list,

I've just finished writing my Twisted-based toy server for Python on
Linux:

gopher://katnip.de:70/0/suslik.tac

I like what it does atm, but I might clean it up a bit and add minor
adjustments as the need arises.

Suslik can generate directory listings (based on MIME type guessing) and
work with stub menus (hostname and port will be added automatically for
local paths, long inline texts will be split into lines and have the
dummy path, host and port data appended accordingly, empty lines are
treated as inline text). I've managed to emulate CGI, too --
QUERY_STRING will be passed as expected and all available environment
variables are set.

I suppose you could also create a CGI script with a proper response for
searches (the search will be passed as QUERY_STRING), but Suslik offers
no special support for searches beyond that.

If you want to try the server for yourself, download the tac file and
run it with twistd ("twistd -ny /path/to/suslik.tac"). You need to have
Python and Twisted installed (Twisted can be installed with
"easy_install twisted" if you have easy_install). Suslik must be run as
root (for now) and assumes there is a system user called gopher that can
be used to run CGI scripts. Obviously you should adjust the settings
(hostname, port, docroot) in the script to suit your environment.

Cheers,

Alan




More information about the Gopher-Project mailing list