Package aquarium :: Package wsadaptor :: Module GlassAdaptor :: Class GlassAdaptor
[show private | hide private]
[frames | no frames]

Class GlassAdaptor

WebServerAdaptor --+
                   |
                  GlassAdaptor


This subclass of WebServerAdaptor is for the Glass Web server.

The following urlscheme modules can be used with this Web server adaptor: ScriptName.

The following attributes are used:

mainGlobals
This is a dict of globals() received from __main__ containing things such as stdin, stdout, env, etc.

The following private variables are used:

_responseCode, _responseCodeMsg
Save these until writeHeaders gets called.

Hiding Glass Behind Apache

Hiding Glass behind Apache (i.e. using Apache as a reverse proxy) is actually fairly simple:

  1. Get Glass working by itself.

  2. Configure Apache to act as a reverse proxy. At the very simplest, do something like:

    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "/var/www/html">
        ...
    #
    # Redirect everything to Glass.  Match any uri and forward it on to
    # localhost at port 8000.
    #
        RewriteEngine On
        RewriteRule ^(.*)$ http://localhost:8000/$1 [P]
    </Directory>
    

Method Summary
  __init__(self, mainGlobals)
Receive the mainGlobals from __main__.
  getCgiEnv(self)
Return CGI-like environmental variables.
  getForm(self)
Instantiate some cgi.FieldStorage and return the instance.
  setResponseCode(self, code, msg)
Save these until writeHeaders gets called.
  write(self, s)
Output a string.
  writeHeaders(self, headersList)
Extend the base class in order to output the response code.

Method Details

__init__(self, mainGlobals)
(Constructor)

Receive the mainGlobals from __main__.

getCgiEnv(self)

Return CGI-like environmental variables.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.getCgiEnv

getForm(self)

Instantiate some cgi.FieldStorage and return the instance.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.getForm

setResponseCode(self, code, msg='')

Save these until writeHeaders gets called.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.setResponseCode

write(self, s)

Output a string.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.write

writeHeaders(self, headersList)

Extend the base class in order to output the response code.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.writeHeaders

Generated by Epydoc 2.1 on Mon Jan 1 16:34:19 2007 http://epydoc.sf.net