You are currently viewing the BOOK: Professional XMPP Programming with JavaScript and jQuery section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
However, I wanted to take the next step and hit against a locally (desktop) installed instance of Openfire, using their Built-In connection manager.
I enabled the following with HTTP Bindings Settings on port 7070:
Clients can connect to this server using HTTP binding.
Allows BOSH clients with limited access to connect to the server
In the simple hello.js example I changed Strophe.Connection("http://bosh.metajack.im:5280/xmpp-httpbind")
to
Strophe.Connection("http://<local-machine>:7070/http-bind")
I can created some sample users and connect via Pidgin just fine. However, when I run the sample Hello app, it just hangs, not seeming to connect.
In Firebug console it is showing error 302 aborted
I am using Spring Source Tool Suite as an IDE for my hello application, which in turn fires up a local instance of Tomcat. Any ideas what I am doing wrong?
Thanks.
Last edited by iowadeifan; November 22nd, 2010 at 07:41 PM.
The Following User Says Thank You to iowadeifan For This Useful Post:
In the simple hello.js example I changed Strophe.Connection("http://bosh.metajack.im:5280/xmpp-httpbind")
to
Strophe.Connection("http://<local-machine>:7070/http-bind")
Openfire is unique in that it requires you to use a trailing slash on the http-bind resource. Try:
and now I am getting different error showing up in Firebug
200 Aborted
XML Parsing Error: no element found Location: moz-nullprincipal:{8eead87c-3f20-427a-8ead-e5d8d2791768} Line Number 1, Column 1:
This looks like something is going wrong within the browser. Does it work if you disable firebug or if you turn Firebug's "Show XMLHttpRequests" option off in the Console tab (use the little arrow right next to the word 'Console').
I often find that Firebug and recent Firefox's break this particular functionality, and it has to be shut off for it to work correctly.
If that doesn't fix it, can you tell me some more information about your set up? Are you using CORS or flXHR? What is the URL of the page hosting hello.html (ie, is this a cross domain request)?
The Following User Says Thank You to metajack For This Useful Post:
I am using flXHR. It is literally the exact hello example out of your book, with the only change 1 line of code to switch the pointer to a different connection manager.
So I have gotten a little farther. If I use Apache to serve up the web pages locally, the client can talk to my local connection manager just fine. It is just when I run the html through my IDE which in turn is running tomcat that the client has issues communicating with my local connection manager.
In the end, I hope to build a Java web app that can talk to my back end as well as do messaging/presence from the client to client using Strophe and XMPP.
Still stumped, but at least a little progress....
Last edited by iowadeifan; November 23rd, 2010 at 05:59 PM.
So I have gotten a little farther. If I use Apache to serve up the web pages locally, the client can talk to my local connection manager just fine. It is just when I run the html through my IDE which in turn is running tomcat that the client has issues communicating with my local connection manager.
That's very odd. The only thing I can think of is that it is setting the wrong mimetype for the Flash file or something. Once the code is all loaded, there is no difference where it is running from (as long as it's running from an http:// URL). So I suspect that one of the components isn't loading correctly.
Perhaps use curl to check the mimetypes of a few different kinds of files and see if they look ok?
The Following User Says Thank You to metajack For This Useful Post:
Without more info I won't be able to help you. What browser are you using? What's the URL of hello.html in your browser when you get this problem? What errors do you see in the JavaScript console?