source: trip-planner-front/node_modules/sockjs-client/lib/transport/htmlfile.js@ 1ad8e64

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

initial commit

  • Property mode set to 100644
File size: 710 bytes
Line 
1'use strict';
2
3var inherits = require('inherits')
4 , HtmlfileReceiver = require('./receiver/htmlfile')
5 , XHRLocalObject = require('./sender/xhr-local')
6 , AjaxBasedTransport = require('./lib/ajax-based')
7 ;
8
9function HtmlFileTransport(transUrl) {
10 if (!HtmlfileReceiver.enabled) {
11 throw new Error('Transport created when disabled');
12 }
13 AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver, XHRLocalObject);
14}
15
16inherits(HtmlFileTransport, AjaxBasedTransport);
17
18HtmlFileTransport.enabled = function(info) {
19 return HtmlfileReceiver.enabled && info.sameOrigin;
20};
21
22HtmlFileTransport.transportName = 'htmlfile';
23HtmlFileTransport.roundTrips = 2;
24
25module.exports = HtmlFileTransport;
Note: See TracBrowser for help on using the repository browser.