SHARE
TWEET

bino-echobot.tac

a guest Aug 31st, 2010 108 Never
  1. #echobot.tac
  2. from twisted.application import internet, service
  3. from twisted.words.protocols.jabber import jid
  4. from wokkel.client import XMPPClient
  5.  
  6. from twisted.web import server, xmlrpc
  7. from twisted.internet import ssl
  8.  
  9.  
  10. from echobot import EchoBotProtocol, MyRPC
  11.  
  12. application = service.Application("echobot")
  13. svcCollection = service.IServiceCollection(application)
  14.  
  15. xmppclient = XMPPClient(jid.internJID("iwic02@jabber.int/mybot"), "123")
  16. xmppclient.logTraffic = False
  17. echobot = EchoBotProtocol()
  18. echobot.setHandlerParent(xmppclient)
  19. #xmppclient.setServiceParent(application)
  20. xmppclient.setServiceParent(svcCollection)
  21.  
  22. LISTEN_HOST='localhost'
  23. LISTEN_PORT=50008
  24.  
  25. site = server.Site(MyRPC())
  26. i = internet.TCPServer(LISTEN_PORT, site, interface=LISTEN_HOST)
  27. i.setServiceParent(svcCollection)
RAW Paste Data
Top