Strophe with Firefox

81 views
Skip to first unread message

Peter George

unread,
Nov 30, 2009, 1:00:15 PM11/30/09
to Strophe
All,

Does Strophe work the same on Firefox and IE? I've had no problems
using it with IE, but on Firefox 3.5, the new operation on
Strophe.Connection does not seem to be returning back based on what
Firebug's breakpoints show.

var BOSH_SERVICE = 'http://<server address here>:5280/http-bind';
new Strophe.Connection(BOSH_SERVICE);

Any ideas?

Thanks,
Peter

tm65

unread,
Dec 2, 2009, 2:16:37 AM12/2/09
to Strophe

Hi Peter,

Without knowing the details of your setup, I couldn't comment on
what's wrong there. Though I recently encountered FF problem with
Strophe specifically too. It has to do with the new cross-site
security feature put into FF 3.5, for the so-called pre-flighted
requests.

I have a nginx/ejabberd/Strophe stack. The echobot works without
problem on all browsers (FF, IE, Chrome) standalone, i.e just
echobot.html. Then I modified it slightly, and integrated the html in
a Ruby on Rails project. The almost identical echobot html is now
returned as the response to an Rails action method.

In the standalone mode, Strophe sends a POST to the proxied BOSH
endpoint for each request, everybody is happy. In the RoR mode,
somehow FF 3.5 and Chrome determine that the Strophe request is
preflighted, and so a HTTP OPTIONS method is used first. The response
from nginx/ejabberd is HTTP 400. The response headers aren't clear
about where that 400 happens, but I bet it's probably because ejabberd
doesn't understand HTTP OPTIONS, and nginx just being a middleman
passing the response back. IE8 keeps sending POST in my RoR mode, so
the echobot continue to work.

Try using WireShark to watch the packets in your case, then you can
find out if we're talking about the same problem. I couldn't find any
good solution yet. Theoretically I probably could create a nginx
module to intercept the HTTP OPTIONS request to the BOSH endpoint, and
return the needed response to make FF happy, though it's another can
of worms there.

I know it's not too helpful but that's all I know so far. Good luck!

Br,
james

PGP Chicago

unread,
Dec 2, 2009, 2:34:54 AM12/2/09
to str...@googlegroups.com
James/others:
 
Thank you very much for your help.  I just figured it out.  Seems like the problem was related to Firefox being unable to perform a POST on a URL with a non-standard port (5280) from Javascript when the serving page was from the standard port 80.  Firebug was showing POSTs to http-post/ returning 200 OK, but the response was empty and the POST was marked in red.  IE 8.0 didn't have any problem with this.
 
To get around Firefox's security precautions (I assume), I setup Apache to proxy calls to <server>/http-bind/ through port 5280 and I updated my Javascript code to POST to /http-bind/.  Everything works fine now.
 
Peter
--

You received this message because you are subscribed to the Google Groups "Strophe" group.
To post to this group, send email to str...@googlegroups.com.
To unsubscribe from this group, send email to strophe+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/strophe?hl=en.



Reply all
Reply to author
Forward
0 new messages