source: trip-planner-front/node_modules/sockjs-client/lib/transport/eventsource.js

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

initial commit

  • Property mode set to 100644
File size: 766 bytes
RevLine 
[6a3a178]1'use strict';
2
3var inherits = require('inherits')
4 , AjaxBasedTransport = require('./lib/ajax-based')
5 , EventSourceReceiver = require('./receiver/eventsource')
6 , XHRCorsObject = require('./sender/xhr-cors')
7 , EventSourceDriver = require('eventsource')
8 ;
9
10function EventSourceTransport(transUrl) {
11 if (!EventSourceTransport.enabled()) {
12 throw new Error('Transport created when disabled');
13 }
14
15 AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceReceiver, XHRCorsObject);
16}
17
18inherits(EventSourceTransport, AjaxBasedTransport);
19
20EventSourceTransport.enabled = function() {
21 return !!EventSourceDriver;
22};
23
24EventSourceTransport.transportName = 'eventsource';
25EventSourceTransport.roundTrips = 2;
26
27module.exports = EventSourceTransport;
Note: See TracBrowser for help on using the repository browser.