Wondering why flxhr is being used?

661 views
Skip to first unread message

Dan

unread,
Jul 18, 2011, 12:07:42 PM7/18/11
to Strophe
Hello,

I am new to Strophe and was wondering why flxhr was being used rather
than the ajax capabilities provided by jquery?

Thanks

Jack Moffitt

unread,
Jul 18, 2011, 12:27:40 PM7/18/11
to str...@googlegroups.com
> I am new to Strophe and was wondering why flxhr was being used rather
> than the ajax capabilities provided by jquery?

Because of this: http://en.wikipedia.org/wiki/Same_origin_policy

Note that flxhr isn't required. It's an optional plugin. It's mostly
used for people to have an easy way to get started where they don't
have to proxy their BOSH service or have to worry about whether the
browser or the server supports Cross-Origin Resource Sharing (CORS).

Natively, Strophe.js uses XMLHttpRequest just like jQuery does.

jack.

Federico Di Gregorio

unread,
Jul 19, 2011, 3:58:22 AM7/19/11
to str...@googlegroups.com

Hi Jack,

is there any resource listing which browser versions support CORS and
how to enable CORS togheter with strophe?

federico

--
Federico Di Gregorio f...@initd.org
Datemi uno spigolo. Che lo arrotondo tutto. -- <dani>

Jack Moffitt

unread,
Jul 19, 2011, 9:04:43 AM7/19/11
to str...@googlegroups.com
> is there any resource listing which browser versions support CORS and
> how to enable CORS togheter with strophe?

CORS needs no special code (except on IE), just some extra headers on
the server side. I think all the XMPP tools support CORS now except
for Openfire.

Firefox 3.5 and later, safari (including mobile safari) and chrome for
the past year or so (probably opera too, but I haven't checked). IE8
supports it via a special XDomain object, which strophe does not yet
have support for.

I just found out about this site the other day:
http://enable-cors.org/ It seems to have more information on CORS in
general.

jack.

Barnettech

unread,
Jul 3, 2012, 9:38:57 AM7/3/12
to str...@googlegroups.com, lon...@babson.edu
Does Strophe support internet explorer 8+ using CORS yet?  This post is a bit old and I'm struggling to get internet explorers users happy.

Daniel Dormont

unread,
Jul 3, 2012, 10:02:39 AM7/3/12
to str...@googlegroups.com
There's a plugin for it. There seem to be a couple of versions floating around but here's one: https://gist.github.com/1095825

--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To view this discussion on the web visit https://groups.google.com/d/msg/strophe/-/OvJ2hWpV4GAJ.
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.

Barnettech

unread,
Jul 3, 2012, 10:10:07 AM7/3/12
to str...@googlegroups.com
thanks do you just include that as another javascript file for your project, how do you add the plugin to your project?

thanks
To unsubscribe from this group, send email to strophe+unsubscribe@googlegroups.com.

Jack Moffitt

unread,
Jul 9, 2012, 9:14:06 AM7/9/12
to str...@googlegroups.com
> thanks do you just include that as another javascript file for your project,
> how do you add the plugin to your project?

Include the plugin after strophe.js. That's all that's needed. The
plugin's code will add itself to the strophe plugins list and it will
then be available.

jack.

Daniel Dormont

unread,
Jul 11, 2012, 4:51:05 PM7/11/12
to str...@googlegroups.com
By the way, I've been meaning to ask - I've seen a few different versions of that plugin floating around, I'm not sure how different the code is but in the one I'm using, I'm seeing an issue where if the service URL is under HTTPS, and the CORS plugin is being used, the requests don't get made and Strophe enters a loop saying "Strophe error: XHR open failed" 

Is this familiar to anyone? Where might I look to hash this out?

dan


jack.

--
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.

Jack Moffitt

unread,
Jul 11, 2012, 5:04:05 PM7/11/12
to str...@googlegroups.com
> By the way, I've been meaning to ask - I've seen a few different versions of
> that plugin floating around, I'm not sure how different the code is but in
> the one I'm using, I'm seeing an issue where if the service URL is under
> HTTPS, and the CORS plugin is being used, the requests don't get made and
> Strophe enters a loop saying "Strophe error: XHR open failed"

There's no CORS plugin. CORS is built in to the browser's XMLHttpRequest.

If you mean the Flash plugin, I have no idea if going from http ->
https constitutes a security violation in Flash. Have you tried making
the BOSH endpoint and your application endpoint have the same protocol
(http or https)?

jack.

Daniel Dormont

unread,
Jul 11, 2012, 5:06:00 PM7/11/12
to str...@googlegroups.com
Sorry I meant the XDomainRequest plugin at  https://gist.github.com/1095825

dan


jack.

piotr_cz

unread,
Jul 16, 2012, 10:19:47 AM7/16/12
to str...@googlegroups.com

ejabberd (probably http_bind module) supports CORS.
chrome does preflight (OPTIONS) request before allowing Strophe to Attach/ Connect and once a time later on.

Daniel Dormont

unread,
Jul 24, 2012, 12:15:29 PM7/24/12
to str...@googlegroups.com
A little more information on this. One of my coworkers, running IE 9 in IE 8 compatibility mode, is getting a weird error in this plugin

SCRIPT438: Object doesn't support this property or method 
strophe.xdomainrequest.js, line 10 character 6

Line 10 contains this:

XDomainRequest.prototype.oldsend.apply(this, arguments);

Any ideas on how to fix this? It does not seem to be a problem in either native IE 8 or native IE 9 as best we can tell.

thanks,
Dan
Reply all
Reply to author
Forward
0 new messages