Connecting to OpenFire with strophe.js 404 error

I am trying to connect to openfire via strophe.js on android phonegap and here is my bosh url BOSH_SERVICE : '[http://192.168.1.4:7070/http-bind/](http://192.168.1.4:7070/http-bind/)' but I keep getting 404 HTTP error:

Error 404 Not Found

HTTP ERROR 404

Problem accessing /httpbind/. Reason:

    Not Found

Powered by Jetty://



















Openfire is working (I have checked it with Pidgin) and my I am using WAMP as server. How to fix this?


EDIT:

After I insert http://192.168.1.4:7070/http-bind/ in browser I got this message:

HTTP ERROR 404

Problem accessing /httpbind/. Reason:

Not Found

Powered by Jetty://

but if I enter http://192.168.1.4:7070/http-bind/?<body%20rid=“1”/> I get good response:
BOSH("<body xmlns=“http://jabber.org/protocol/httpbind” xmlns:stream=“http://etherx.jabber.org/streams” authid=“a8bb9175” sid=“a8bb9175” secure=“true” requests=“2” inactivity=“30” polling=“5” wait=“60”>stream:features<mechanisms xmlns=“urn:ietf:params:xml:ns:xmpp-sasl”>DIGEST-MD5PLAINANONYMOUSCRAM-MD5</me chanism><compression xmlns=“http://jabber.org/features/compress”>zlib<bind xmlns=“urn:ietf:params:xml:ns:xmpp-bind”/><session xmlns=“urn:ietf:params:xml:ns:xmpp-session”/></stream:features>")

Sure, you connect to “/http-bind/” ???

The error says “/httpbind/” (without dash).

I tried both and none of them worked. Maybe I copy error when I didnt use dash, not sure.

That’s the error during HTTP GET, you need to HTTP POST.

Maybe I forgot to mention, and it is helpfull, but I am using WAMP server with openfire

When you insert http://192.168.1.4:7070/http-bind/ into your browser, you are making a direct connection to Openfire. That connection is method GET, which is not supported and throws the error you see.

Ok, but how can I fix it? What is causing it?

Do you actually get that error when you attempt to connect with strophe? Keep in mind that do to same origin / same port constraints, strophe needs to call back to the server it was served from. So if you are serving strophe from a web server, then you need to proxy the /http-bind/ to openfire.

1 Like

Proxy /http-bind/ helped in this case, but now I got another issue. When I login with username and pass that exists in OpenFire server it and go to Sessions tab I see that I am logged in as anonymus. Can you help me here or should I open new thread?


EDIT

Somehow I fixed this issue by adding "@192.168.1.3" to username (I have no idea how this helped) but now my presence in OpenFire is Offline.**
**