Sha256: f4eebb9378ac3fbc8373f09829e7a56926ab34e8a99724c87f93452664abbc65

Contents?: true

Size: 984 Bytes

Versions: 34

Compression:

Stored size: 984 Bytes

Contents

'use strict';

var inherits = require('inherits')
  , AjaxBasedTransport = require('./lib/ajax-based')
  , XhrReceiver = require('./receiver/xhr')
  , XDRObject = require('./sender/xdr')
  ;

// According to:
//   http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests
//   http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/

function XdrStreamingTransport(transUrl) {
  if (!XDRObject.enabled) {
    throw new Error('Transport created when disabled');
  }
  AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XDRObject);
}

inherits(XdrStreamingTransport, AjaxBasedTransport);

XdrStreamingTransport.enabled = function(info) {
  if (info.cookie_needed || info.nullOrigin) {
    return false;
  }
  return XDRObject.enabled && info.sameScheme;
};

XdrStreamingTransport.transportName = 'xdr-streaming';
XdrStreamingTransport.roundTrips = 2; // preflight, ajax

module.exports = XdrStreamingTransport;

Version data entries

34 entries across 33 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.18.0 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.18.2 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.16.1 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.15.2 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.18.4 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.18.1 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.14.0 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
tang-0.2.1 spec/tang_app/node_modules/sockjs-client/lib/transport/xdr-streaming.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/sockjs-client/lib/transport/xdr-streaming.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/sockjs-client/lib/transport/xdr-streaming.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/sockjs-client/lib/transport/xdr-streaming.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/sockjs-client/lib/transport/xdr-streaming.js
tang-0.2.0 spec/tang_app/node_modules/sockjs-client/lib/transport/xdr-streaming.js
tang-0.1.0 spec/tang_app/node_modules/sockjs-client/lib/transport/xdr-streaming.js
tang-0.0.9 spec/tang_app/node_modules/sockjs-client/lib/transport/xdr-streaming.js
enju_library-0.3.8 spec/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
ilog-0.4.1 node_modules/sockjs-client/lib/transport/xdr-streaming.js