File: ping_component.tac

package info (click to toggle)
wokkel 18.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,352 kB
  • sloc: python: 11,753; makefile: 6
file content (30 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
An XMPP Ping server as an external server-side component.

This ping server assumes the domain C{'ping'}.
"""

from twisted.application import service
from wokkel import component
from wokkel.ping import PingHandler

# Configuration parameters

EXT_HOST = 'localhost'
EXT_PORT = 5347
SECRET = 'secret'
DOMAIN = 'ping'
LOG_TRAFFIC = True


# Set up the Twisted application

application = service.Application("Ping Component")

router = component.Router()
pingComponent = component.Component(EXT_HOST, EXT_PORT, DOMAIN, SECRET)
pingComponent.logTraffic = LOG_TRAFFIC
pingComponent.setServiceParent(application)

pingHandler = PingHandler()
pingHandler.setHandlerParent(pingComponent)