Webclient for Openfire XMPP server

Hi all,

I have installed Openfire on a Windows Server 2008 VPS. Hit some nags WRT SQL Server configuration, but now its all running fine.

I am able to login using Pidgin with some test users I created, however, I would like to be able to provide an in-browser webclient interface. The openfire instance is for a small community and its comprised mostly of non-technical people who would have difficulty installing and configuring something like a standalone client.

I am trying to use Candy (http://amiadogroup.github.com/candy/) as its JS based. However, I am unable to login using it. It would be great if someone in the community could suggest a cross-platform webclient that I could use on my windows server.


It appears that Candy uses Strophe.js under the hood, which is the same library I’m using (successfully) to connect to Openfire. Should work.

My guess, without any more information, is that the username, password, or domain is being screwed up somehow, either by you (no offense) or through some kind of mangling that occurs in the code. Are you putting in the full jid, and not just the user name? That is, test@example.com, not just ‘test’? At a glance, it appears that it requires the full jid. To enable login without the portion after the ampersand, I think you’d need to modify Candy a bit, appending your chosen domain after the “jidOrHost” variable somewhere inside the definition for Candy.Core.connect()

If you’ve tried it with the full JID already, I’d try dumping some of the variables from Candy.Core.connect() to the console to see exactly what’s being sent. If you’re not familiar with using the javascript console, the short version is that you add “console.log([some variable name]);” wherever you want to see the value of a variable, then open the console in your browser, then load the page and attempt to do whatever it is that you’re trying to troubleshoot. Chrome and Safari have built-in Javascript consoles (though you’ll need to enable it in Safari) and for Firefox there is the Firebug plugin that provides something similar. You should be able to find tutorials on how to enable/use these features.

Alternatively, since there are only a few variables really at issue here, you could skip all of that and simply type “alert([variable name]);” for each variable you want to see, to generate a pop up displaying the variable’s contents. For example, you could insert, right after the line containing “self.connect = function(jidOrHost, password) {”:



This is all in candy.bundle.js, which is the editable version of the library–candy.min.js won’t work, as it’s not designed to be edited.

That’s where I’d start to troubleshoot it, personally. I think Candy should work.

Sorry if any of this is way below your level of expertise; can’t judge how much you know about this stuff, so I’m trying to cover everything.

The only problem is that nobody seems to know how to create a proxy rewrite on IIS, similar to this one using Apache’s mod_rewrite:

RewriteRule http-bind/ [http://yourhost.com:5280/http-bind/](http://yourhost.com:5280/http-bind/) [P]

If you find a solution, please let us know or edit the official wiki page: https://github.com/amiadogroup/candy/wiki/HTTP-Proxy-Configuration

I’m replying here because I don’t have access to edit the wiki.

Proxying is no problem. A product I was already using to do URL rewriting, Ionics ISAPI Rewrite Filter, can also do proxying. Configuration is done per-website or per-virtual-directory, using an INI file containing directives that look and work like Apache’s mod_rewrite and mod_proxy.

And IIRF is open-source! It’s available on Codeplex. (Codeplex is a Microsoft-hosted site showcasing open-source products based on MS technologies. Like SourceForge, but focused solely on Microsoft platforms.)

I got the proxy working by putting the following two lines into my iirf.ini in the root directory of my website:

RewriteEngine ON

ProxyPass ^/http-bind/ http://my.chatserver.address.here:7070/http-bind/

My problem is that the IIRF is doing what it’s supposed to, but Openfire is returning an error 404…

oh, and fyi, I’m using Candy too…

I had a Windows sysadmin from the hosting provider of my box look at this. The guy spent about three hours trying to get Candy working under IIS without success. We tried using IIS7’s URL rewrite and with IIS ARR without success.

I ended up installing apache on the machine’s 2nd IP. Worked like a charm straight away. Plan on testing with nginx when I have the time

Well, I don’t have a choice in my case. It is IIS. And I got the proxy to work just fine. I can confirm that the request is getting to the Openfire server. The 404 is coming from the Openfire server.

When does openfire return a 404? When using Candy or directly accessing the http-bind site from candy?

Well, I found a combination that works flawlessly on Windows. It DOES require IIS 7 or 7.5 (meaning you need to be running Windows 2008 Server or newer), but the original poster said they’re running Win2008, so they should be OK.

IIS 7.x

Microsoft Application Request Routing module (available at no charge)

Microsoft URL Rewriting module (also available at no charge)

Now, I have things working with JWChat, but I’m also going to try Candy; haven’t decided which client I want to use yet.

I think part of my initial problem may have been my laptop. It is sitting behind a router doing NAT. Using IIS 7.5 Express, ARR and the URL Rewriting module, I could make connections to the Openfire server, but not reliably.

Now I have IIS 7 set up on a virtual server sitting at a data center, with no NAT in front of it, and I can reliably connect to Openfire every time.

I’m also going to try IIRF at some point soon, because IIRF would be a great solution for people running IIS 6, and I’m curious whether I can get it to work. That isn’t a priority, however, as my paying client’s website will be running on IIS 7, and I already have a solution that runs on IIS 7.

By the way, here’s my recipe for success…

  • in the IIS manager, I click on the server’s hostname, then I double click “Application Request Routing Cache”
  • then I click “Server Proxy Settings”
  • then I make sure “Enable proxy”, “Keep alive” and “Reverse rewrite host in response headers” are checked.
  • I do NOT check “Use URL Rewrite to inspect incoming requests.”
  • I click Apply to save my changes.
  • On the left side of the IIS Manager window, I expand “Sites” and click on the website I’m going to configure.
  • I then add a “Reverse Proxy” rule. Basically, you’ll need a rule that proxies any request for
    **where XXXX is the port you configured for HTTP Binding.

Michael: when accessing the http-bind site from Candy. I did get things working with JWChat and am going to try to get Candy working later today. Will post my results here.

Just downloaded candy… all I had to do was edit index.html to point to the URL that is redirected to my Openfire server. Worked out of the box. And it’s MUCH prettier than jwchat.


And I had totally forgotten that I have a Github account, so I can edit the wiki… I will update it later with instructions for setting up the reverse proxy under IIS 7.

Hopefully sometime during the next couple weeks I will have time to test IIRF with IIS 7 and IIS 6, too.

Wow, that’s a very good thing to hear!

Thanks for updating instructions regarding IIS in the wiki, that will save a lot of time to other users