Connection error while using stanza using ejabberd bosh to connect to jid account on localhost

I installed ejabberd on my machine and it works fine.

localhost:5280/admin localhost:5280/http-bind 

It also displays "ejabberd mod_http_bind". Implementing XMPP over BOSH (XEP-0206) "I think it works fine.

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

My code is as follows:

 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 also added proxypass for http://localhost:5280/http-bind in the apache httpd.conf file.

I can’t understand what the problem is.

+3
source share
1 answer

To debug whether ejabberd really receives your Bosh requests, restart ejabberd with {log_level, 5} (install this in your /etc/ejabberd/ejabberd.cfg file). Then, when you connect to ejabberd using strophe, keep an eye on the logs by doing tail -f /var/log/ejabberd/ejabberd.log . If you do not see anything, this means that your requests fail somewhere in the context of the proxy server. If you see something, kindly update your question with relevant magazines to help you better.

Alternatively, you can update log_level on the fly through the 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 suggested standard installation paths for ejabberd.cfg and ejabberd.log . If you have an alternative installation prefix, please kindly update the paths accordingly.

+1
source

All Articles