XMPP Server's Router.

A router connects the different components of the XMPP service and routes messages between them based on the given routing table.

Connected components are trusted to have correct addressing in the stanzas they offer for routing.

A route destination of None adds a default route. Traffic for which no specific route exists, will be routed to this default route.

Present Since8.2
Instance Variable routes Routes based on the host part of JIDs. Maps host names to the EventDispatchers that should receive the traffic. A key of None means the default route. (type: dict)
Method __init__ Undocumented
Method addRoute Add a new route.
Method removeRoute Remove a route.
Method route Route a stanza.
routes =
Routes based on the host part of JIDs. Maps host names to the EventDispatchers that should receive the traffic. A key of None means the default route. (type: dict)
def __init__(self): (source)
Undocumented
def addRoute(self, destination, xs): (source)

Add a new route.

The passed XML Stream xs will have an observer for all stanzas added to route its outgoing traffic. In turn, traffic for destination will be passed to this stream.

ParametersdestinationDestination of the route to be added as a host name or None for the default route. (type: str or None.)
xsXML Stream to register the route for. (type: EventDispatcher.)
def removeRoute(self, destination, xs): (source)

Remove a route.

ParametersdestinationDestination of the route that should be removed. (type: str.)
xsXML Stream to remove the route for. (type: EventDispatcher.)
def route(self, stanza): (source)

Route a stanza.

ParametersstanzaThe stanza to be routed. (type: domish.Element.)
API Documentation for Twisted, generated by pydoctor at 2017-09-23 19:45:03.