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
ilog-0.4.0 node_modules/sockjs-client/lib/transport/xdr-streaming.js
ilog-0.3.3 node_modules/sockjs-client/lib/transport/xdr-streaming.js
jester-data-8.0.0 node_modules/sockjs-client/lib/transport/xdr-streaming.js
ezii-os-5.2.1 node_modules/sockjs-client/lib/transport/xdr-streaming.js
ezii-os-2.0.1 node_modules/sockjs-client/lib/transport/xdr-streaming.js
ezii-os-1.1.0 node_modules/sockjs-client/lib/transport/xdr-streaming.js
ezii-os-1.0.0 node_modules/sockjs-client/lib/transport/xdr-streaming.js
ezii-os-0.0.0.1.0 node_modules/sockjs-client/lib/transport/xdr-streaming.js
ezii-os-0.0.0.0.1 node_modules/sockjs-client/lib/transport/xdr-streaming.js
optimacms-0.4.3 spec/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
optimacms-0.4.2 spec/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
cortex-0.1.3 spec/dummy/node_modules/sockjs-client/lib/transport/xdr-streaming.js
dragonfly_puppeteer-0.1.0 node_modules/sockjs-client/lib/transport/xdr-streaming.js
lanes-0.8.0 node_modules/sockjs-client/lib/transport/xdr-streaming.js