1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
4 # Originally written by Darryl Vandorp
5 # http://randomthoughts.vandorp.ca/
7 from twisted.words.protocols.jabber import client, jid
8 from twisted.words.xish import domish
9 from twisted.internet import reactor
14 presence = domish.Element(('jabber:client','presence'))
15 xmlstream.send(presence)
17 xmlstream.addObserver('/message', debug)
18 xmlstream.addObserver('/presence', debug)
19 xmlstream.addObserver('/iq', debug)
22 print elem.toXml().encode('utf-8')
25 myJid = jid.JID('username@server.jabber/twisted_words')
26 factory = client.basicClientFactory(myJid, 'password')
27 factory.addBootstrap('//event/stream/authd',authd)
28 reactor.connectTCP('server.jabber',5222,factory)