3

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.

4

1 回答 1

1

要调试 ejabberd 是否真的在接收您的 Bosh 请求,请重新启动 ejabberd {log_level, 5}(在您的/etc/ejabberd/ejabberd.cfg文件中设置它)。然后,当您使用 strophe 连接到 ejabberd 时,请通过执行tail -f /var/log/ejabberd/ejabberd.log. 如果您没有看到任何内容,则意味着您的请求在代理上下文中的某处失败。如果您确实看到了什么,请使用相关日志更新您的问题,以便我们更好地帮助您。

或者,您可以log_level通过 ejabberd 调试 shell 即时更新:

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

注意:ejabberd.cfg我假设和的标准安装路径ejabberd.log。如果您有备用安装前缀,请相应地更新路径。

于 2012-11-01T05:33:25.703 回答