From df8460130f8810ef877c3167c12f49a4561ed574 Mon Sep 17 00:00:00 2001 From: Nick Martin Date: Wed, 7 Mar 2012 18:08:59 -0800 Subject: [PATCH] Only use polling, not streaming or websockets. This improves cross-browser compatibility, and shouldn't hurt too much. We may want to revisit this later. --- packages/stream/stream_client.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/stream/stream_client.js b/packages/stream/stream_client.js index 55e0cae2a3..3d7b16064d 100644 --- a/packages/stream/stream_client.js +++ b/packages/stream/stream_client.js @@ -239,7 +239,12 @@ _.extend(Meteor._Stream.prototype, { var self = this; self._cleanup_socket(); // cleanup the old socket, if there was one. - self.socket = new SockJS(self.url, undefined, {debug: false}); + self.socket = new SockJS(self.url, undefined, { + debug: false, protocols_whitelist: [ + // only allow polling protocols. no websockets or streaming. + // streaming makes safari spin, and websockets hurt chrome. + 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling' + ]}); self.socket.onmessage = function (data) { // first message we get when we're connecting goes to _connected, // which connects us. All subsequent messages (while connected) go to