Last updated at 3:18 pm UTC on 14 January 2006
The Pluggable WebServer (PWS) is mostly obsolete now, and is superseded by the newer Comanche web server.
The Pluggable WebServer (http://www.cc.gatech.edu/fac/mark.guzdial/squeak/pws/) is a web server and toolkit for flexibly creating CGI scripts. I designed and implemented it to help me create different kinds of collaborative tools: e.g. Virtual Other-Than-Communities. PWS builds on the work of GeorgGollmann
and is strongly influenced by TimJones
PWS is pluggable in three ways:
Decoupled URL Parsing and CGI Execution: The core of PWS is Georg's WebServer: the networking components and the parsing of the HTTP header. But, the interpreting the URL is decoupled from PWS; in Georg's WebServer, the URL is interpreted as an object and message; in Tim's WebTalk, the URL is a class name; and in most servers, the URL is a file reference. Instead, a separate ServerAction is handed the PWS request, and the ServerAction can determine how to interpret the URL and what to do to return: e.g., pass on a file, execute a CGI script and return the result, etc. A PWS contains a table of ServerActions, so one server can interpret URLs in several different ways.
Pluggable Server Actions: There are two ServerActions provided that are "pluggable" in the traditional sense: The instances hold the blocks to be executed for URL interpretation, and as instance variables. PluggableServerAction takes a processBlock and a returnBlock for processing any forms input and then computing a return HTML page, respectively. A SinglePlugServerAction just takes a processBlock and requires the processing block to get the response back to the request.
Embedded HTML: EmbeddedServerAction serves files, but wherever it encounters Unknown function: tags, it evaluates the embedded string as Smalltalk, and replaces the tag with the result. Actual interpretation and replacement occurs in the HTMLformatter class, which can be used as-is in Georg's or Tim's servers, too.
Examples include SqueakWiki