2014-08-27 38 views
0

我正在使用stophe示例连接到我本地的openfire xmpp服务。我更改了BOSH网址以适应我的本地开放式服务。 我进入JID和密码,点击连接按钮。而且它显示了以下消息:与波什和openfire Strophe连接错误

Strophe is connecting. 
SENT: <body rid='1995627735' xmlns='http://jabber.org/protocol/httpbind' to='admin'  xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/> 
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:stream='http://etherx.jabber.org/streams' from='mobi-pc' authid='d04856d8' sid='d04856d8' secure='true' requests='2' inactivity='30' polling='5' wait='60' hold='1' ack='1995627735' maxpause='300' ver='1.6'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features></body> 
SENT: <body rid='1995627736' xmlns='http://jabber.org/protocol/httpbind' sid='d04856d8'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/></body> 
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/></body> 
SENT: <body rid='1995627737' xmlns='http://jabber.org/protocol/httpbind' sid='d04856d8' to='admin' xml:lang='en' xmpp:restart='true' xmlns:xmpp='urn:xmpp:xbosh'/> 
RECV: <body xmlns='http://jabber.org/protocol/httpbind' xmlns:stream='http://etherx.jabber.org/streams'><stream:features><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features></body> 
SENT: <body rid='1995627738' xmlns='http://jabber.org/protocol/httpbind' sid='d04856d8'><iq type='set' id='_bind_auth_2' xmlns='jabber:client'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq></body> 
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' type='result' id='_bind_auth_2' to='mobi-pc/d04856d8'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>[email protected]/d04856d8</jid></bind></iq></body> 
SENT: <body rid='1995627739' xmlns='http://jabber.org/protocol/httpbind' sid='d04856d8'><iq type='set' id='_session_auth_2' xmlns='jabber:client'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body> 
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' type='result' id='_session_auth_2' to='[email protected]/d04856d8'/></body> 
Strophe is connected. 
Strophe is disconnecting. 
SENT: <body rid='1995627740' xmlns='http://jabber.org/protocol/httpbind' sid='d04856d8' type='terminate'><presence xmlns='jabber:client' type='unavailable'/></body> 
RECV: <body xmlns='http://jabber.org/protocol/httpbind' type='terminate'/> 
Strophe is disconnected. 

任何想法来克服这个问题

+0

你能否提供给我如何设置与strophe xmpp聊天的代码...我使用它遇到了困难..请帮助 – xxbinxx 2014-09-25 04:50:24

回答

2

这并不是问题的了..

如果你读的basic.js(的basic.html)的代码有一个回调函数

function onConnect(status) 
{ 
    ... 
    ... 
    } else if (status == Strophe.Status.CONNECTED) { 
     log('Strophe is connected.'); 
     connection.disconnect(); 
    } 
} 

表明,当STA tus等于CONNECTED,记录消息,然后立即断开连接。

+0

意味着它的工作正常 – 2014-08-27 13:25:24

+0

@mobipnpn,是按预期工作。 – 2014-08-27 13:28:06