source: trip-planner-front/node_modules/sockjs-client/lib/transport/xdr-streaming.js@ bdd6491

Last change on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 984 bytes
Line 
1'use strict';
2
3var inherits = require('inherits')
4 , AjaxBasedTransport = require('./lib/ajax-based')
5 , XhrReceiver = require('./receiver/xhr')
6 , XDRObject = require('./sender/xdr')
7 ;
8
9// According to:
10// http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests
11// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/
12
13function XdrStreamingTransport(transUrl) {
14 if (!XDRObject.enabled) {
15 throw new Error('Transport created when disabled');
16 }
17 AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XDRObject);
18}
19
20inherits(XdrStreamingTransport, AjaxBasedTransport);
21
22XdrStreamingTransport.enabled = function(info) {
23 if (info.cookie_needed || info.nullOrigin) {
24 return false;
25 }
26 return XDRObject.enabled && info.sameScheme;
27};
28
29XdrStreamingTransport.transportName = 'xdr-streaming';
30XdrStreamingTransport.roundTrips = 2; // preflight, ajax
31
32module.exports = XdrStreamingTransport;
Note: See TracBrowser for help on using the repository browser.