autobahn.twisted.resource

Classes

WSGIRootResource

Root resource when you want a WSGI resource be the default serving

WebSocketResource

A Twisted Web resource for WebSocket.

Module Contents

class WSGIRootResource(wsgiResource, children)[source]

Bases: twisted.web.resource.Resource

Root resource when you want a WSGI resource be the default serving resource for a Twisted Web site, but have subpaths served by different resources.

This is a hack needed since twisted.web.wsgi.WSGIResource. does not provide a putChild() method.

_wsgiResource[source]
children[source]
getChild(path, request)[source]
class WebSocketResource(factory)[source]

Bases: object

A Twisted Web resource for WebSocket.

_factory[source]
getChildWithDefault(name, request)[source]

This resource cannot have children, hence this will always fail.

isLeaf = True[source]
putChild(path, child)[source]

This resource cannot have children, hence this is always ignored.

render(request)[source]

Render the resource. This will takeover the transport underlying the request, create a autobahn.twisted.websocket.WebSocketServerProtocol and let that do any subsequent communication.