3
votes

I have installed ejabberd on my machine and its running fine.

localhost:5280/admin

localhost:5280/http-bind

It is also displaying "ejabberd mod_http_bind An implementation of XMPP over BOSH (XEP-0206)" I guess it's working fine.

When I try to create a connection with Strophe I get the connection status as CONNFAIL.

My code goes as follow :

var conn = new Strophe.Connection('http://localhost:5280/http-bind');
conn.connect(data.jid, data.password, function (status) {

// jid=user@localhost


if(status===Strophe.Status.CONNECTING){

alert('connecting...!!');

}

if(status===Strophe.Status.AUTHFAIL){

alert('auth failure...!!');

}

if(status===Strophe.Status.CONNFAIL){

alert('connection falied !!');

}}

I keep getting CONNFAIL.

I have also added proxypass forhttp://localhost:5280/http-bind in apache httpd.conf file.

I am not able to figure out what is the problem.

1

1 Answers

1
votes

To debug whether ejabberd is really receiving your Bosh requests, restart ejabberd with {log_level, 5} (set this inside your /etc/ejabberd/ejabberd.cfg file). Then as you are making connection to ejabberd using strophe, watch for logs by doing tail -f /var/log/ejabberd/ejabberd.log. If you don't see anything, it means your requests are failing somewhere within proxy context. If you do see something, kindly update your question with relevant logs for us to help you out better.

Alternately you can update log_level on the fly via ejabberd debug shell:

$ sudo ejabberdctl debug
....
Eshell V5.8.5  (abort with ^G)
(ejabberd@localhost)1> ejabberd_loglevel:set(5).
{module,ejabberd_logger}
(ejabberd@localhost)2>

Note: I assumed standard installation paths for ejabberd.cfg and ejabberd.log. If you have an alternate install prefix, kindly update the paths accordingly.