CANDY chat with Openfire : receiving empty response while connecting to a autologin chat room

StackOverflow https://stackoverflow.com/questions/14570118

  •  05-03-2022
  •  | 
  •  

Question

I finally have the openfire server installed - admittedly noob to XMPP - but I'm getting there :)

I modified the .htaccess & now trying to hit the http://166.xx.xx.xx/candy-chat-candy-ca544b1/example/index.html on my server

The page shows me a "connecting.." message and hangs there.

Here is my setup before I delve into the firebug post/response.

I've modified the example/index.html as such :

$(document).ready(function() {
    Candy.init('http://166.xx.xx.xx:7070/http-bind/', {
        core: { debug: true },
        autojoin: ['Opentalk@conference.166.xx.xx.xx'],
        view: { language : 'en' }
    });

    Candy.Core.connect('166.xx.xx.xx', null, 'Guest'); // Connect anonymously to a specific server
});

In firebug, I see that the response is empty. However the post entry in firebug shows a 200 OK

And firebug complains (which I think is because the response is empty) --> "

XML Parsing Error: no element found Location: moz-nullprincipal:{80250471-6b20-4144-ad88-92777a926018} Line Number 1, Column 1:

Here is the post

<body rid='3954428912' xmlns='http://jabber.org/protocol/httpbind' to='166.xx.xx.xx' 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'/>

Since my debug is turned on, I see the same message as post :

SENT: <body rid='3954428912' xmlns='http://jabber.org/protocol/httpbind' to='166.xx.xx.xx' 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'/>

Note : The only difference I see in my configuration is the the cross-domain part. The setup screenshot shown on github has this field empty, while mine has the default entry, I don't know if that is in fact a problem though.

I'm doing something wrong, but can't put a finger as to what.. Any pointers about debugging further would be great !


----------------+++++++++++--------------

Update 2/1 **
Thanks Michael, seems making the changes has taken it a step forward !!

Now I'm getting a grey page instead of hanging at "connecting..".
Seems the connection is now being established. I'm not sure if the PrivacyListError is critical (correct me).
I looked into the candy.js & seems that if the list doesn't exist it'll create one.
The next error does seem critical, since it talks about service unavailable..

Success

SENT: <body rid='2569503371' xmlns='http://jabber.org/protocol/httpbind' sid='b967c785'><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='b967c785@myservername.com/b967c785'/></body>  
[Connection] 
Connected [Jabber] 
Anonymous login 
[Connection] Attached

Success

POST http-bind/ 200 OK 101ms    

SENT: <body rid='2569503372' xmlns='http://jabber.org/protocol/httpbind' sid='b967c785'><presence xmlns='jabber:client'/><iq type='get' xmlns='jabber:client'><query xmlns='jabber:iq:private'><storage xmlns='storage:bookmarks'/></query></iq><iq type='get' from='b967c785@myservername.com/b967c785' id='get1' xmlns='jabber:client'><query xmlns='jabber:iq:privacy'><list name='ignore'/></query></iq></body>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' type='result' to='b967c785@myservername.com/b967c785'><query xmlns='jabber:iq:private'><storage xmlns='storage:bookmarks'/></query></iq></body>
[Jabber] Bookmarks

Error

POST http-bind/ 200 OK 56ms 
SENT: <body rid='2569503373' xmlns='http://jabber.org/protocol/httpbind' sid='b967c785'/>    
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client'     type='error' id='get1' to='b967c785@myservername.com/b967c785'><query xmlns='jabber:iq:privacy'><list name='ignore'/></query><error code='503' type='cancel'>     <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq></body>   
[Jabber] PrivacyListError

Error - this seems more serious

POST http-bind/ 200 OK 74ms 
SENT: <body rid='2569503374' xmlns='http://jabber.org/protocol/httpbind' 
sid='b967c785'><iq type='set' from='b967c785@myservername.com/b967c785' id='set1'
 xmlns='jabber:client'><query xmlns='jabber:iq:privacy'><list name='ignore'><item 
action='allow' order='0'/></list></query></iq><iq type='set' 
from='b967c785@myservername.com/b967c785' id='set2' xmlns='jabber:client'><query 
xmlns='jabber:iq:privacy'><active name='ignore'/></query></iq></body>

RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' 
type='error' id='set1' to='b967c785@myservername.com/b967c785'><query 
xmlns='jabber:iq:privacy'><list name='ignore'><item action='allow' order='0'/></list>
</query><error code='503' type='cancel'><service-unavailable 
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq></body>

Error - Last one, before it kinda hangs in the there

POST http-bind/ 200 OK 60ms 
SENT: <body rid='2569503375' xmlns='http://jabber.org/protocol/httpbind' sid='b967c785'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' 
type='error' id='set2' to='b967c785@myservername.com/b967c785'><query 
xmlns='jabber:iq:privacy'><active name='ignore'/></query><error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq></body>

Last ajax call fired

POST http-bind/ 200 OK 60167ms  
SENT: <body rid='2569503376' xmlns='http://jabber.org/protocol/httpbind' sid='b967c785'/>
RECV: <body xmlns='http://jabber.org/protocol/httpbind'/>
POST http-bind/
SENT: <body rid='2569503377' xmlns='http://jabber.org/protocol/httpbind' sid='b967c785'/>
Was it helpful?

Solution

Your http-bind url seems to be wrong as well as the autojoin and the first param of the connect function call.

If you configured the HTTP Proxy configuration correctly, the standard example/index.html should work. You only need to change/add the autojoin param and change the connect function call.

Regarding the autojoin parameter: You configured a virtualhost on the XMPP server. You need to use this one as the hostname, not the IP. So it would look like autojoin: ['Opentalk@conference.example.com'].

The same applies to the first parameter of connect() you need to provide the virtual hostname of the XMPP Server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top