请告诉我如何检索 SID 和 JID。我正在使用 Strope JS。
<body rid='489923353' xmlns='http://jabber.org/protocol/httpbind' sid='ab7f5957' to='127.0.0.1' xml:lang='en' xmpp:restart='true' xmlns:xmpp='urn:xmpp:xbosh'/>
var conn = new Strophe.Connection(bosh_service);
然而,conn.sid or conn.rid没有返回相同的数字。
经过这个和那个之后,我想我找到了答案!
else if(status === Strophe.Status.CONNECTED){
//get roster
var iq = $iq({type: 'get'}).c('query', {xmlns: 'jabber:iq:roster'});
Chat.connection.sendIQ(iq, Chat.on_roster);
//on chat
Chat.connection.addHandler(Chat.on_message,null, "message", "chat");
$("#presence").html("Connection SID" + Chat.connection.sid + "Connection RID" + Chat.connection.rid);
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)