0
votes

I am using stophe example to connect to my local openfire xmpp service. I changed the BOSH url to accomodate my local openfire service. I entered the JID and password and clicked the connect button .And it is showing the following message:

 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>d04856d8@mobi-pc/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='d04856d8@mobi-pc/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.

Any ideas to overcome this problem

1
Can you provide me the code of how to setup xmpp chat with strophe... I'm having hard trouble using it.. please helpxxbinxx

1 Answers

2
votes

That is not problem at all..

If you read the code of basic.js (of basic.html) there is a callback function

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

indicates that when status equals to CONNECTED, log the message and then disconnect immediately afterwards.