You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
578 B
24 lines
578 B
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const polling_1 = require("./polling");
|
|
const polling_jsonp_1 = require("./polling-jsonp");
|
|
const websocket_1 = require("./websocket");
|
|
exports.default = {
|
|
polling: polling,
|
|
websocket: websocket_1.WebSocket,
|
|
};
|
|
/**
|
|
* Polling polymorphic constructor.
|
|
*
|
|
* @api private
|
|
*/
|
|
function polling(req) {
|
|
if ("string" === typeof req._query.j) {
|
|
return new polling_jsonp_1.JSONP(req);
|
|
}
|
|
else {
|
|
return new polling_1.Polling(req);
|
|
}
|
|
}
|
|
polling.upgradesTo = ["websocket"];
|