Works great in Firefox and Opera, but not as well in Safari and Chrome

324 views
Skip to first unread message

Vito Botta

unread,
Jun 18, 2011, 7:20:29 PM6/18/11
to Faye users
Hi,

I am using Faye for a sort of console that displays some updates
(basically a log of events) in realtime.
I am using it with SSL and Nginx, and it works very well on Firefox
and Opera, but in both Chrome and Safari I can only see one or
sometimes two updates and then no more as if the connection is dropped
or something, while instead Firefox and Opera keep reacting to new
messages.

I enabled the debugging in Faye (0.6.1 with Rack) and I see almost
always "Queueing for client" when the client is either Safari or
Chrome.

Any idea?

(Firefox 4.0.1, Safari 5.0.5, Chrome 12.0.742.100, Opera 11.11)

James Coglan

unread,
Jun 18, 2011, 7:52:36 PM6/18/11
to faye-...@googlegroups.com
On 19 June 2011 00:20, Vito Botta <ma...@vitobotta.com> wrote:
I enabled the debugging in Faye (0.6.1 with Rack) and I see almost
always "Queueing for client" when the client is either Safari or
Chrome.

Any idea?

What do you see in the Faye logs on the client side in Chrome? 

Vito Botta

unread,
Jun 18, 2011, 8:12:13 PM6/18/11
to faye-...@googlegroups.com
Hi James, thanks for replying :)

I just tried again and in Chrome's console I see this:

XMLHttpRequest cannot load https://domainA.com/faye. Origin https://domainB.com is not allowed by Access-Control-Allow-Origin.

Then I see:

Unexpected response code: 200


I am basically using faye on a separate domain because I'd love to share it across applications for realtime updates. So that I just include the script and am done.
Do I need to do anything in particular to make Faye work with two different domains? 

Thanks

James Coglan

unread,
Jun 19, 2011, 11:53:11 AM6/19/11
to Faye users
On Jun 19, 1:12 am, Vito Botta <v...@botta.name> wrote:
> XMLHttpRequest cannot loadhttps://domainA.com/faye. Originhttps://domainB.comis not allowed by Access-Control-Allow-Origin.

This has just been fixed on my master branch. Could you give it a spin
and see if this fixes your issue? See related bug report at
https://github.com/jcoglan/faye/pull/71.

> Unexpected response code: 200

What we think is happening here is that Transport.WebSocket.isUsable()
tries to make a WebSocket connection, this fails, and the client falls
back to another transport. (Which I'd expect if you're using nginx
with proxy_pass since it doesn't support WebSocket.) But some time
later, data comes over the socket that the browser was not expecting,
and does not route to the onerror handler on the socket.

Is your app broken because of this, or are you just seeing errors in
the console?

James Coglan

unread,
Jun 19, 2011, 3:10:03 PM6/19/11
to Faye users
On Jun 19, 4:53 pm, James Coglan <jcog...@gmail.com> wrote:
> On Jun 19, 1:12 am, Vito Botta <v...@botta.name> wrote:
>
> > XMLHttpRequest cannot loadhttps://domainA.com/faye. Originhttps://domainB.comisnot allowed by Access-Control-Allow-Origin.
>
> This has just been fixed on my master branch. Could you give it a spin
> and see if this fixes your issue? See related bug report athttps://github.com/jcoglan/faye/pull/71.

This is now in a release -- see
http://groups.google.com/group/faye-users/browse_thread/thread/fffcc10a12177023
and let me know if your app is still broken.
Reply all
Reply to author
Forward
0 new messages