Last change
on this file since 170:bb143a4ae70d was
65:6936acbdb9bd,
checked in by Ralph Meijer <ralphm@…>, 13 years ago
|
Add support for the XMPP Ping protocol.
Author: ralphm
Fixes #55.
This adds a whole bunch of examples around the ping protocol in different
settings for both the pinger and pingee: as a external server-side component,
as a standalone server with server-to-server connectivity and as a client.
Also updates the disco support to allow for non-deferred responses from
subprotocol handlers
|
File size:
686 bytes
|
Line | |
---|
1 | """ |
---|
2 | An XMPP Ping server as an external server-side component. |
---|
3 | |
---|
4 | This ping server assumes the domain C{'ping'}. |
---|
5 | """ |
---|
6 | |
---|
7 | from twisted.application import service |
---|
8 | from wokkel import component |
---|
9 | from wokkel.ping import PingHandler |
---|
10 | |
---|
11 | # Configuration parameters |
---|
12 | |
---|
13 | EXT_HOST = 'localhost' |
---|
14 | EXT_PORT = 5347 |
---|
15 | SECRET = 'secret' |
---|
16 | DOMAIN = 'ping' |
---|
17 | LOG_TRAFFIC = True |
---|
18 | |
---|
19 | |
---|
20 | # Set up the Twisted application |
---|
21 | |
---|
22 | application = service.Application("Ping Component") |
---|
23 | |
---|
24 | router = component.Router() |
---|
25 | pingComponent = component.Component(EXT_HOST, EXT_PORT, DOMAIN, SECRET) |
---|
26 | pingComponent.logTraffic = LOG_TRAFFIC |
---|
27 | pingComponent.setServiceParent(application) |
---|
28 | |
---|
29 | pingHandler = PingHandler() |
---|
30 | pingHandler.setHandlerParent(pingComponent) |
---|
Note: See
TracBrowser
for help on using the repository browser.