Hunt
Hunt

Reputation: 8425

enable http-bind on openfire

I am trying to enable BOSH connection over Openfire so that i can create a XMPP client over a web. curretly i am testing it with the strophe.js.

the problem is when i try to fire following url in a browser i am getting

http://www.mydomain.com:7070/http-bind

following error

HTTP ERROR 400


    Problem accessing /http-bind/. Reason:

        Bad Request
    Powered by Jetty://

here is my server setting , i saw few threads but they arent helpful

enter image description here

update

i have made a connection using strophe but i am getting following error in browser trance

enter image description here

Upvotes: 4

Views: 25203

Answers (6)

Talha
Talha

Reputation: 19252

Below works for me, i am pinging the openfire server after some interval so, clients remains alive... i just append "/?<body rid='1'" with the server name and i don't have 400 bad request error.

 XMPPconnection.sendIQ($iq({ to: XMPPserver+"/?<body rid='1'/>", from: CurrentUserJID, type: "get" }).c('ping', { xmlns: "urn:xmpp:ping" }));

Upvotes: 0

HDNU
HDNU

Reputation: 1

If server is properly configured it should display

HTTP ERROR: 404

Problem accessing /http-bind/. Reason:

  Not Found
Powered by Jetty://

The Bad Request was gone when I uninstall and reinstall Openfire as in here.

Upvotes: 0

Vijay Lathiya
Vijay Lathiya

Reputation: 1227

its now working in my system.

i think your error encountered may actually be a configuration issue with the openfire.

It is designed to reply with HTTP 400 Bad Request if there is no element in the request. You can test this yourself by providing a element in your query.

Try the following URL in your browser:

 http://www.servername:7070/http-bind/?<body rid="1"/>

Upvotes: 10

Terry
Terry

Reputation: 1

You should use proxy to repost the request to the openfire server . Because, the js post cannot support cross domain.

Notes:
1.I use jsjac , but I think it's not important .
2.If you sure your config is right , please restart you openfire server . It's my experience .

Upvotes: 0

Milos Jovanovic
Milos Jovanovic

Reputation: 306

In your update Strophe is sending OPTIONS HTTP requests which means that it is negotiating cross domain communication. Requests are painted red which means that this is failing for some reason. Probably misconfiguration. There is a nice article about that here: http://metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/

Otherwise, when Strophe does its regular BOSH communication it uses POST method.

Upvotes: 2

Alex
Alex

Reputation: 4136

Your setup is correct. The page the browser displays to you is also normal. Openfires BOSH component is not designed to work in a Browser with HTTP GET, only with BOSH clients like strophe. Try to connect with strophe.

Upvotes: 0

Related Questions