Thursday, April 15, 2010

The end of cross-domain hassle for BOSH

    Exciting news to anyone who is using BOSH with ejabberd - since release 2.1.3 you don't have to proxy your http-bind link anymore. Imagine no nginx configuration, no Tape, just point exactly to where your http-bind link is. This, I believe, albeit looking rather insignificant news, will bring XMPP development to the new level of acceptance.
I learned first about it from Jack Moffitt's site. When I had a chance, I installed ejabberd 2.1.3 on AWS and fired a test web page that logs in using Strophe right from my local box. The habit of crafting nginx configuration first has developed over time so strong that I didn't actually expect it to work. Fortunately, ejabberd proved me wrong - it works, and much better and faster without proxying (which is logical to expect).
   So if you read tutorial on how to set up BOSH with ejabberd, you can now skip the whole topic talking about nginx, cross-domain limitations and proxy. In your Strophe code, instead of doing, for example:
var BOSH_SERVICE = "/http-bind";
you do:
var BOSH_SERVICE = "http://your_ejabberd_server:5280/http-bind";

   The consequences are many, the most important I think is how easy it becomes to embed BOSH anywhere.