Пример #1
0
 def prebind(self):
     b_client = BOSHClient(self.jid, self.jpassword, self.bosh)
     session = b_client.startSession()
     if session:
         if type(session) == tuple:
             return session[1], session[1]
         return b_client.rid, b_client.sid
     return '', ''
Пример #2
0
 def test_bosh_authentication(self):
     jid = JID('admin@localhost')
     jid.resource = str(random.randint(0, 1000))
     client = BOSHClient(jid, 'admin', 'http://localhost:5280/http-bind/')
     self.assertTrue(client.startSession())
     rid = client.rid
     sid = client.sid
     self.assertTrue(rid is not None)
     self.assertTrue(sid is not None)