source: trip-planner-front/node_modules/engine.io/build/engine.io.js@ 571e0df

Last change on this file since 571e0df was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 2.0 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.protocol = exports.Transport = exports.Socket = exports.uServer = exports.parser = exports.attach = exports.listen = exports.transports = exports.Server = void 0;
4const http_1 = require("http");
5const server_1 = require("./server");
6Object.defineProperty(exports, "Server", { enumerable: true, get: function () { return server_1.Server; } });
7const index_1 = require("./transports/index");
8exports.transports = index_1.default;
9const parser = require("engine.io-parser");
10exports.parser = parser;
11var userver_1 = require("./userver");
12Object.defineProperty(exports, "uServer", { enumerable: true, get: function () { return userver_1.uServer; } });
13var socket_1 = require("./socket");
14Object.defineProperty(exports, "Socket", { enumerable: true, get: function () { return socket_1.Socket; } });
15var transport_1 = require("./transport");
16Object.defineProperty(exports, "Transport", { enumerable: true, get: function () { return transport_1.Transport; } });
17exports.protocol = parser.protocol;
18/**
19 * Creates an http.Server exclusively used for WS upgrades.
20 *
21 * @param {Number} port
22 * @param {Function} callback
23 * @param {Object} options
24 * @return {Server} websocket.io server
25 * @api public
26 */
27function listen(port, options, fn) {
28 if ("function" === typeof options) {
29 fn = options;
30 options = {};
31 }
32 const server = (0, http_1.createServer)(function (req, res) {
33 res.writeHead(501);
34 res.end("Not Implemented");
35 });
36 // create engine server
37 const engine = attach(server, options);
38 engine.httpServer = server;
39 server.listen(port, fn);
40 return engine;
41}
42exports.listen = listen;
43/**
44 * Captures upgrade requests for a http.Server.
45 *
46 * @param {http.Server} server
47 * @param {Object} options
48 * @return {Server} engine server
49 * @api public
50 */
51function attach(server, options) {
52 const engine = new server_1.Server(options);
53 engine.attach(server, options);
54 return engine;
55}
56exports.attach = attach;
Note: See TracBrowser for help on using the repository browser.