Erlang/OTP Forums

Author Message

<  Ejabberd mailing list  ~  http_bind BAD REQUEST

Guest
Posted: Wed Aug 12, 2009 12:45 am Reply with quote
Guest
seeing this error when trying http_bind

config file has :

{5280, ejabberd_http, [http_bind, {request_handlers,
[{["http-bind"], mod_http_bind}]}]}

{mod_vcard, []},
{mod_http_bind, []},
{mod_version, []}
.......


SNIFF TRACE:

OPTIONS /http-bind/ HTTP/1.1
Host: example.org:5280
Access-Control-Request-Method: POST
Origin: http://example.org
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_7; en-us)
AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19
Content-Type: application/xml
Referer: http://example.org/strophe/basic.html
Access-Control-Request-Headers: Content-Type
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Cookie: __unam=9a43afc-1229ad2ff32-6f6ff114-10;
jiveforums.admin.logviewer=debug.size=0&info.size=0&warn.size=0&error.size=0
Content-Length: 0
Connection: keep-alive

HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=utf-8
Content-Length: 336

<?xml version='1.0'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en"><head><meta http-equiv="Content-Type" content="text/html;
charset=utf-8"/></head><body><h1>400 Bad Request</h1></body></html>

Any ideas ? This is ejabberd 2.0.5

AD
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist
Guest
Posted: Wed Aug 12, 2009 1:20 am Reply with quote
Guest
i think this may be a strophe specific issue as posting to the service
looks OK, here is the response

<body xmlns='http://jabber.org/protocol/httpbind'
sid='eb5931b8af681752c6c0a480eada110e8a418a3a' wait='60' requests='2'
inactivity='30' maxpause='120' polling='2' ver='1.6'
from='example.org' secure='true' authid='1441189004'
xmlns:xmpp='urn:xmpp:xbosh'
xmlns:stream='http://etherx.jabber.org/streams'/>

Anyone have issues with strophe and http-bind ?

On Tue, Aug 11, 2009 at 8:44 PM,
straightflush@gmail.com<straightflush@gmail.com> wrote:
> seeing this error when trying http_bind
>
> config file has :
>
>
Guest
Posted: Wed Aug 12, 2009 2:00 am Reply with quote
Guest
On Tue, Aug 11, 2009 at 7:44 PM,
straightflush@gmail.com<straightflush@gmail.com> wrote:
> OPTIONS /http-bind/ HTTP/1.1

The OPTIONS method is not expected.

> Access-Control-Request-Method: POST
> Origin: http://example.org
> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_7; en-us)
> AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19

Looks like Safari is reacting to some possible security issues. Are
you working across different domains?

https://developer.mozilla.org/En/HTTP_Access_Control

(I googled access control request method)

Cheers,
Andy
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist
Guest
Posted: Wed Aug 12, 2009 2:10 am Reply with quote
Guest
yep your right, works OK with firefox. Whats wierd is i am trying the
example from strophe (basic.html) and nothing is getting registered
back to the handler, even though I see it in the ejabberd log. Whats
also wierd is i keep seeing this "Ding Dong" "Terminating session"
now:

=INFO REPORT==== 2009-08-11 22:09:47 ===
D(<0.526.0>:ejabberd_http_bind:505) : ding dong

=INFO REPORT==== 2009-08-11 22:09:47 ===
D(<0.526.0>:ejabberd_http_bind:544) : terminate: deleting session
a6311f394e1a7309b7d42506f6a92ef24ddd8968

Any ideas ?

On Tue, Aug 11, 2009 at 8:44 PM,
straightflush@gmail.com<straightflush@gmail.com> wrote:
> seeing this error when trying http_bind
>
> config file has :
>
>
Guest
Posted: Wed Aug 12, 2009 8:25 pm Reply with quote
Guest
On Aug 11, 2009, at 10:10 PM, straightflush@gmail.com wrote:

> yep your right, works OK with firefox. Whats wierd is i am trying the
> example from strophe (basic.html) and nothing is getting registered
> back to the handler, even though I see it in the ejabberd log. Whats
> also wierd is i keep seeing this "Ding Dong" "Terminating session"
> now:

Ding Dong is logged when the max inactivity has been reached and the
BOSH session is too be removed.

myers
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist
Guest
Posted: Wed Aug 12, 2009 9:22 pm Reply with quote
Guest
thanks, something does not seem to be right with the strophe library.
has anyone got this to work with strophe?

On Wed, Aug 12, 2009 at 4:25 PM, Myers
Carpenter<mcarpenter@rosettastone.com> wrote:
>
> On Aug 11, 2009, at 10:10 PM, straightflush@gmail.com wrote:
>
>> yep your right, works OK with firefox.
Guest
Posted: Wed Aug 12, 2009 10:03 pm Reply with quote
Guest
> 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@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist
Guest
Posted: Wed Aug 12, 2009 11:10 pm Reply with quote
Guest
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@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.
Guest
Posted: Wed Aug 12, 2009 11:41 pm Reply with quote
Guest
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@jabber.ru [mailto:ejabberd-bounces@jabber.ru] On
> Behalf Of straightflush@gmail.com
> Sent: Wednesday, August 12, 2009 4:10 PM
> To: ejabberd@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@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.
Guest
Posted: Wed Aug 12, 2009 11:48 pm Reply with quote
Guest
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 config:
Guest
Posted: Thu Aug 13, 2009 12:07 am Reply with quote
Guest
A couple of things:
Guest
Posted: Thu Aug 13, 2009 4:59 am Reply with quote
Guest
> 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.
Guest
Posted: Thu Aug 13, 2009 1:29 pm Reply with quote
Guest
interesting. I was serving ejabberd over example.org, port 5280 and
then apache over example.org port 80 so the strophe javascript was
requesting http-bind over the same domain. Not sure if this would
still be an issue but it seems to mitigate some of these cross-domain
issues no ?



On Thu, Aug 13, 2009 at 12:59 AM, Jack Moffitt<jack@chesspark.com> wrote:
>> 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.
Guest
Posted: Thu Aug 13, 2009 2:24 pm Reply with quote
Guest
On Aug 13, 2009, at 9:21 AM, straightflush@gmail.com wrote:

> interesting. I was serving ejabberd over example.org, port 5280 and
> then apache over example.org port 80 so the strophe javascript was
> requesting http-bind over the same domain. Not sure if this would
> still be an issue but it seems to mitigate some of these cross-domain
> issues no ?

According to http://en.wikipedia.org/wiki/Same_origin_policy coming
from two different ports will not work.

myers


_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist
Guest
Posted: Thu Aug 13, 2009 4:33 pm Reply with quote
Guest
that makes sense actually. I am going to try hosting apache
virtualhost on 5280 and see if this solves it...



On Thu, Aug 13, 2009 at 10:24 AM, Myers
Carpenter<mcarpenter@rosettastone.com> wrote:
>
> On Aug 13, 2009, at 9:21 AM, straightflush@gmail.com wrote:
>
>> interesting. I was serving ejabberd over example.org, port 5280 and
>> then apache over example.org port 80 so the strophe javascript was
>> requesting http-bind over the same domain.

Display posts from previous:  

All times are GMT
Page 1 of 2
Goto page 1, 2  Next
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum