Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

strophe connect openfire error

I input a jid and pwd on a html form, and use Strophe to connect to openfire, but when I press the login button, the xmpp server response is error 302. I enabled the option on openfire, and restarted it.

var BOSH_SERVICE = 'http://ip:7070/http-bind';
    $('#btn-login').click(function() {
    if(!connected) {
        connection = new Strophe.Connection(BOSH_SERVICE);
        connection.connect($("#input-jid").val(), $("#input-pwd").val(), onConnect);
        jid = $("#input-jid").val();
    }
});

It seems a little harder than to use smack in java because of the network problem?

like image 929
Ran Avatar asked Dec 05 '25 04:12

Ran


1 Answers

The problem is in the uri specified in BOSH_SERVICE.

Correct uri is:

http://ip:7070/http-bind/

Pay attention to the / at the bottom of the string.

like image 87
beaver Avatar answered Dec 10 '25 10:12

beaver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!