24 lines
672 B
JavaScript
Raw Normal View History

2023-10-10 22:00:26 +02:00
"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");
2025-01-25 10:46:42 +01:00
const webtransport_1 = require("./webtransport");
2023-10-10 22:00:26 +02:00
exports.default = {
polling: polling,
2025-01-25 10:46:42 +01:00
websocket: websocket_1.WebSocket,
webtransport: webtransport_1.WebTransport,
2023-10-10 22:00:26 +02:00
};
/**
* Polling polymorphic constructor.
*/
function polling(req) {
if ("string" === typeof req._query.j) {
return new polling_jsonp_1.JSONP(req);
}
else {
return new polling_1.Polling(req);
}
}
2025-01-25 10:46:42 +01:00
polling.upgradesTo = ["websocket", "webtransport"];