Vladimir Pekez
Vladimir Pekez

Reputation: 21

unable to connect to open fire with strophe

I'm having some trouble with connecting on local openfire server with strophe. I use this code, and it always gives me status CONNECTING. Can anybody tell me where can be the problem?

function XMPPconnect() {
    var conn = new Strophe.Connection("http://127.0.0.1:5222/http-bind");
    conn.connect("my_username", "my_password", connect);
}

function connect(status) {
    console.log(status);
    if (status === Strophe.Status.CONNECTED) {
        console.log("connected");
    }
}

I've even tried with different ports, and it doesn't work for me. I'm using new strophe version 1.0.2, and with registered user.

Upvotes: 0

Views: 2125

Answers (1)

Vladimir Pekez
Vladimir Pekez

Reputation: 21

I've finally found the problem, so I will post it here for everybody to have it on mind. The problem was because I didn't setup apache server on my localhost. To do that copy these lines on the end of httpd.conf file

ProxyRequests Off
ProxyPass /http-bind http://localhost:7070/http-bind/
ProxyPassReverse /http-bind http://localhost:7070/http-bind/
ProxyPass /http-binds http://localhost:7443/http-bind/
ProxyPassReverse /http-binds http://localhost:7443/http-bind/

After that you need to uncomment these two lines

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

After this two steps you should be able to connect using

http://localhost/http-bind

as BOSH_SERVICE.

Upvotes: 1

Related Questions