[Pkg-javascript-commits] [sockjs-client] 300/434: Separate xhr-polling from xdr-polling - new name for xdr transports.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit 80d2da05b2a339b5b04cef9724640ad5aa19b91d
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Fri Jan 13 15:38:25 2012 +0000

    Separate xhr-polling from xdr-polling - new name for xdr transports.
---
 README.md                   | 15 ++++++++-------
 lib/trans-xhr-streaming.js  | 20 ++++++++++++++++++++
 tests/html/src/tests.coffee |  2 ++
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index bd2cb55..4057822 100644
--- a/README.md
+++ b/README.md
@@ -148,7 +148,7 @@ Supported transports, by browser
 _Browser_       | _Websockets_     | _Streaming_ | _Polling_
 ----------------|------------------|-------------|-----------
 IE 7            | no               | no          | jsonp-polling
-IE 8, 9 (cookies=no) |    no       | xhr-streaming † | xhr-polling †
+IE 8, 9 (cookies=no) |    no       | xdr-streaming † | xdr-polling †
 IE 8, 9 (cookies=yes)|    no       | iframe-htmlfile | iframe-xhr-polling
 Chrome 6-12     | hixie-76         | xhr-streaming   | xhr-polling
 Chrome 14+      | hybi-10          | xhr-streaming   | xhr-polling
@@ -165,10 +165,9 @@ Konqueror       | no               | no          | jsonp-polling
     makes it inaproppriate for deployments when the load balancer uses
     JSESSIONID cookie to do sticky sessions.
 
- * **‡**: Opera 11.00 and Firefox 4.0 shipped with websockets
-     "hixie-76", but disabled the protocol due to security worries
-     just before releasing it. Native Websockets can be enabled by
-     manually chaning a browser setting.
+ * **‡**: Firefox 4.0 and Opera 11.00 and shipped with disabled
+     Websockets "hixie-76". They can still be enabled by manually
+     changing a browser setting.
 
 Supported transports, by name
 -----------------------------
@@ -177,10 +176,12 @@ _Transport_          | _References_
 ---------------------|---------------
 websocket (hixie-76) | [draft-hixie-thewebsocketprotocol-76][^1]
 websocket (hybi-10)  | [draft-ietf-hybi-thewebsocketprotocol-10][^2]
-xhr-streaming        | A simple streaming transport, using [cross domain XHR][^5] or [XDR][^9] [streaming][^7] capability (readyState=3).
+xhr-streaming        | Transport using [Cross domain XHR][^5] [streaming][^7] capability (readyState=3).
+xdr-streaming        | Transport using [XDomainRequest][^9] [streaming][^7] capability (readyState=3).
 iframe-eventsource   | [EventSource][^4] used from an [iframe via postMessage][^3].
 iframe-htmlfile      | [HtmlFile][^8] used from an [iframe via postMessage][^3].
-xhr-polling          | Long-polling using [cross domain XHR][^5] or [XDR][^9].
+xhr-polling          | Long-polling using [cross domain XHR][^5].
+xdr-polling          | Long-polling using [XDomainRequest][^9].
 iframe-xhr-polling   | Long-polling using normal AJAX from an [iframe via postMessage][^3].
 jsnop-polling        | Slow and old fashioned [JSONP polling][^6].
 
diff --git a/lib/trans-xhr-streaming.js b/lib/trans-xhr-streaming.js
index 90aa203..06a103b 100644
--- a/lib/trans-xhr-streaming.js
+++ b/lib/trans-xhr-streaming.js
@@ -37,8 +37,18 @@ XhrStreamingTransport.enabled = function() {
 //   http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/
 
 
+// xdr-streaming
+var XdrStreamingTransport = SockJS['xdr-streaming'] = function(ri, trans_url) {
+    this.run(ri, trans_url, '/xhr_streaming', XhrReceiver, utils.XDRObject);
 };
 
+XdrStreamingTransport.prototype = new AjaxBasedTransport();
+
+XdrStreamingTransport.enabled = function() {
+    return !!_window.XDomainRequest;
+};
+
+
 
 // xhr-polling
 var XhrPollingTransport = SockJS['xhr-polling'] = function(ri, trans_url) {
@@ -49,3 +59,13 @@ XhrPollingTransport.prototype = new AjaxBasedTransport();
 
 XhrPollingTransport.enabled = XhrStreamingTransport.enabled;
 
+
+// xdr-polling
+var XdrPollingTransport = SockJS['xdr-polling'] = function(ri, trans_url) {
+    this.run(ri, trans_url, '/xhr', XhrReceiver, utils.XDRObject);
+};
+
+XdrPollingTransport.prototype = new AjaxBasedTransport();
+
+XdrPollingTransport.enabled = XdrStreamingTransport.enabled;
+
diff --git a/tests/html/src/tests.coffee b/tests/html/src/tests.coffee
index 7319808..8f00a2c 100644
--- a/tests/html/src/tests.coffee
+++ b/tests/html/src/tests.coffee
@@ -1,7 +1,9 @@
 protocols = ['websocket',
+        'xdr-streaming',
         'xhr-streaming',
         'iframe-eventsource',
         'iframe-htmlfile',
+        'xdr-polling',
         'xhr-polling',
         'iframe-xhr-polling',
         'jsonp-polling']

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list