1 # -*- test-case-name: twisted.words.test.test_xmpproutertap -*-
3 # Copyright (c) Twisted Matrix Laboratories.
4 # See LICENSE for details.
6 from twisted.application import strports
7 from twisted.python import usage
8 from twisted.words.protocols.jabber import component
10 class Options(usage.Options):
12 ('port', None, 'tcp:5347:interface=127.0.0.1',
13 'Port components connect to'),
14 ('secret', None, 'secret', 'Router secret'),
18 ('verbose', 'v', 'Log traffic'),
23 def makeService(config):
24 router = component.Router()
25 factory = component.XMPPComponentServerFactory(router, config['secret'])
28 factory.logTraffic = True
30 return strports.service(config['port'], factory)