Part of twisted.web2.vhost View Source View In Hierarchy
Implements interfaces: twisted.web2.iweb.IResource
I do request mangling to insure that children know what host they are being accessed from behind mod_proxy.
Usage:root = MyResource() vur = vhost.VHostURIRewrite(uri='http://hostname:port/path', resource=root) server.Site(vur)
<VirtualHost hostname:port> ProxyPass /path/ http://localhost:8080/ Servername hostname </VirtualHost>
If the trailing / is ommitted in the second argument to ProxyPass VHostURIRewrite will return a 404 response code.
uri must be a fully specified uri complete with scheme://hostname/path/Method | __init__ | |
Method | renderHTTP | Return an IResponse or a deferred which will fire an IResponse. This response will be written to the web browser which initiated the request. |
Method | locateChild | Locate another object which can be adapted to IResource. |
Parameters | uri | The URI to be used for mutating the request. This MUST include
scheme://hostname/path.
(type: str
) |
resource | The resource to serve after mutating the request.
(type: twisted.web2.iweb.IResource
) |
Returns | A 2-tuple of (resource, remaining-path-segments), or a deferred which will fire the above. Causes the object publishing machinery to continue on with specified resource and segments, calling the appropriate method on the specified resource. If you return (self,server.StopTraversal ),
this instructs web2 to immediately stop the lookup stage, and switch to the
rendering stage, leaving the remaining path alone for your render function
to handle.
|