Part of twisted.web2.vhost View Source View In Hierarchy
Parameters | supportNested | If True domain segments will be chopped off until the TLD is reached or a matching virtual host is found. (In which case the child resource can do its own more specific virtual host lookup.) |
Method | __init__ | |
Method | addHost | Add a host to this virtual host. - The Fun Stuff(TM) |
Method | removeHost | Remove the given host. |
Method | locateChild | It's a NameVirtualHost, do you know where your children are? |
Inherited from Resource:
Method | child_ | This method locates a child with a trailing "/"
in the URL. |
Method | putChild | Register a static child. |
Method | http_GET | Respond to a GET request. |
Inherited from RenderMixin (via Resource):
Method | allowedMethods | |
Method | checkPreconditions | Checks all preconditions imposed by this resource upon a request made |
Method | renderHTTP | See iweb.IResource.renderHTTP . |
Method | http_OPTIONS | Respond to a OPTIONS request. |
Method | http_TRACE | Respond to a TRACE request. |
Method | http_HEAD | Respond to a HEAD request. |
Method | render | Subclasses should implement this method to do page rendering. |
Parameters | default | The default resource to be served when encountering an unknown hostname.
(type: twisted.web2.iweb.IResource
or None
) |
This associates a host named 'name' with a resource 'resrc':
nvh.addHost('nevow.com', nevowDirectory) nvh.addHost('divmod.org', divmodDirectory) nvh.addHost('twistedmatrix.com', twistedMatrixDirectory)
I told you that was fun.
Parameters | name | The FQDN to be matched to the 'Host' header.
(type: str
) |
resrc | The twisted.web2.iweb.IResource
to be served as the given hostname.
| |
resource | (type: twisted.web2.iweb.IResource
) |
Parameters | name | The FQDN to remove.
(type: str
) |
This uses locateChild magic so you don't have to mutate the request.