[ejabberd] http_bind BAD REQUEST

Steven Parkes smparkes at smparkes.net
Thu Aug 13 04:06:59 MSD 2009

A couple of things:
- ejabberd does have a web server module which can listen alongside the BOSH
module, so you can use that without having to use an external proxy
(probably not a production thing, but nice for sanity checks).
- You can get around having to load your app from ejabberd by having your
app set its document.domain and creating a hidden iframe loaded with a
single page that is served by ejabbered which also sets document.domain.
It's a little tricky getting this to work since Strophe doesn't really
expect to deal with two documents. There are patches at
http://github.com/smparkes/strophejs/tree/xss (slightly out of date with
HEAD) that make it trivial to use Strophe in this manner (you don't need
Strophe in the iframe, just a doc with the proper domain set).
I've test this latter part a fair amount on Firefox and Safari but not IE
and I haven't put it into production yet. But so far I've avoided going
through an external proxy, which was my goal .
From: Matthew Rushton [mailto:mrushton7 at yahoo.com] 
Sent: Wednesday, August 12, 2009 4:48 PM
To: ejabberd at jabber.ru; smparkes at smparkes.net
Subject: Re: [ejabberd] http_bind BAD REQUEST

I have a very similar setup and it works perfectly. I also saw the exact
same issue you did and like everyone has said it's a same origin
restriction. You need to set up a proxy. I'm using nginx and here is my
        location ~ ^/http-bind$ {
Apache would need a similar setup.

--- On Wed, 8/12/09, Steven Parkes <smparkes at smparkes.net> wrote:

From: Steven Parkes <smparkes at smparkes.net>
Subject: Re: [ejabberd] http_bind BAD REQUEST
To: ejabberd at jabber.ru
Date: Wednesday, August 12, 2009, 7:40 PM
Are you serving basic.html from ejabberd's web server? If you aren't, I
think you're going to hit same origin restrictions (though Firebug should
tell you this, in the console tab I think).

> -----Original Message-----
> From: ejabberd-bounces at jabber.ru [mailto:ejabberd-bounces at jabber.ru] On
> Behalf Of straightflush at gmail.com
> Sent: Wednesday, August 12, 2009 4:10 PM
> To: ejabberd at jabber.ru
> Subject: Re: [ejabberd] http_bind BAD REQUEST
> Thanks jack.  I think we identified Safari as the OPTIONS cultprit
> here, that went away with Firefox.
> I am trying the example basic.html from the strophe library against
> the ejabberd mod_http_bind setup.  I modified the BOSH_SERVICE in
> basic.js to point to http://server:5280/http-bind/ and i dont get much
> further than seing the commands SENT on the screen.  i looked in
> firebug and dont see any response (although it is a 200 OK) that i
> would expect to see over the BOSH connection.
> All i have added is the mod_http_bind to the modules and
>  {5280, ejabberd_http,    [http_bind, {request_handlers,
> [{["http-bind"], mod_http_bind}]}]}
> to the listen section.  I tried testing this using command line XML
> and it seems to work fine, just not from strophe.  Anything specific
> on the ejabberd side that we need to do to make this work ?
> Thanks
> AD
> On Wed, Aug 12, 2009 at 6:03 PM, Jack Moffitt<jack at chesspark.com> wrote:
> >> thanks, something does not seem to be right with the strophe library.
> >> has anyone got this to work with strophe?
> >
> > Strophe has been extensively tested with ejabberd mod_http_bind.  It
> > is powering collecta.com for example.
> >
> > What is the BOSH connection manager url you are giving to strophe?  Is
> > this correctly proxied by your web server?
> >
> > Note that strophe does not send intentionally send OPTIONS method
> > requests; I don't know if this is even possible from JavaScript.
> > Something external to Strophe seems to be at fault here, but I'm happy
> > to help you track it down.
> >
> > jack.
> > _______________________________________________
> > ejabberd mailing list
> > ejabberd at jabber.ru
> > http://lists.jabber.ru/mailman/listinfo/ejabberd
> >
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd

ejabberd mailing list
ejabberd at jabber.ru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20090812/4e47ee42/attachment-0001.html>

More information about the ejabberd mailing list