openportal 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -0
- package/package.json +1 -1
- package/web/.next/static/{A7pW-dtFIbPCSkvE8uenX → Im7EdK1Q3oOmTznohTOr5}/_buildManifest.js +4 -9
- package/web/.next/static/chunks/{2e7bfb90c343ca96.js → 35cc9dbdc670c73c.js} +4 -4
- package/web/.next/static/chunks/4147ffc67a7b837c.css +1 -0
- package/web/.next/static/chunks/{21ab2574b84ad2d1.js → 52b90bc1740162c2.js} +2 -2
- package/web/.next/static/chunks/{9b265e2198b5525f.js → 8644d68bf325ff24.js} +3 -3
- package/web/.next/static/chunks/{03e1846335a31354.js → 9865709466b09f79.js} +3 -3
- package/web/.next/static/chunks/{c20ae04df8cc28be.js → 9ba9a5774c9421bd.js} +3 -3
- package/web/.next/static/chunks/{967a1e0002fe9ae6.js → b5caad256518cb33.js} +3 -3
- package/web/.next/static/chunks/{turbopack-27558c851386934e.js → turbopack-26af71e419c11487.js} +1 -1
- package/web/.next/static/chunks/{turbopack-f4c0881f9723f5a5.js → turbopack-4ad0df7330c00c8d.js} +1 -1
- package/web/.next/static/chunks/{turbopack-26688626142ac58f.js → turbopack-8e653f3ad3a8ed18.js} +1 -1
- package/web/.next/static/chunks/{turbopack-c40ec6674624f1d7.js → turbopack-d5098189d63fd7b8.js} +1 -1
- package/web/apps/web/.next/BUILD_ID +1 -1
- package/web/apps/web/.next/build-manifest.json +14 -24
- package/web/apps/web/.next/routes-manifest.json +0 -12
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__f366ca98._.js +358 -0
- package/web/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__dfeaf8cf._.js → [root-of-the-server]__1a54ba1e._.js} +3 -3
- package/web/apps/web/.next/server/middleware-build-manifest.js +12 -22
- package/web/apps/web/.next/server/next-font-manifest.js +1 -1
- package/web/apps/web/.next/server/next-font-manifest.json +0 -4
- package/web/apps/web/.next/server/pages/404.html +1 -1
- package/web/apps/web/.next/server/pages/500.html +1 -1
- package/web/apps/web/.next/server/pages/_app/build-manifest.json +3 -3
- package/web/apps/web/.next/server/pages/_app/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/api/[[...slugs]].js +1 -2
- package/web/apps/web/.next/server/pages/api/[[...slugs]].js.nft.json +1 -1
- package/web/apps/web/.next/server/pages/index/build-manifest.json +3 -3
- package/web/apps/web/.next/server/pages/index/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/index.html +1 -1
- package/web/apps/web/.next/server/pages/index.js.nft.json +1 -1
- package/web/apps/web/.next/server/pages/session/[id]/build-manifest.json +4 -4
- package/web/apps/web/.next/server/pages/session/[id]/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/session/[id].html +1 -1
- package/web/apps/web/.next/server/pages/session/[id].js.nft.json +1 -1
- package/web/apps/web/.next/server/pages/settings/build-manifest.json +3 -3
- package/web/apps/web/.next/server/pages/settings/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/settings.html +1 -1
- package/web/apps/web/.next/server/pages/settings.js.nft.json +1 -1
- package/web/apps/web/.next/server/pages-manifest.json +0 -2
- package/web/apps/web/package.json +1 -9
- package/web/.next/static/chunks/04d4692d75696297.css +0 -1
- package/web/.next/static/chunks/553710f60e2f2b11.js +0 -1
- package/web/.next/static/chunks/58acbbb4090e3362.js +0 -3
- package/web/.next/static/chunks/6ce1e2f08f961db5.js +0 -2
- package/web/.next/static/chunks/d316d63225992c76.js +0 -10
- package/web/.next/static/chunks/e0c97552ba7a9e3d.js +0 -1
- package/web/.next/static/chunks/fc9c4f2dabfb4e0e.css +0 -1
- package/web/.next/static/chunks/turbopack-1837909a677d116b.js +0 -3
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__0f75905d._.js +0 -3
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__89e85365._.js +0 -358
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__ae1361d0._.js +0 -3
- package/web/apps/web/.next/server/pages/api/terminal/ws/pages-manifest.json +0 -3
- package/web/apps/web/.next/server/pages/api/terminal/ws.js +0 -5
- package/web/apps/web/.next/server/pages/api/terminal/ws.js.map +0 -5
- package/web/apps/web/.next/server/pages/api/terminal/ws.js.nft.json +0 -1
- package/web/apps/web/.next/server/pages/terminal/build-manifest.json +0 -20
- package/web/apps/web/.next/server/pages/terminal/client-build-manifest.json +0 -5
- package/web/apps/web/.next/server/pages/terminal/next-font-manifest.json +0 -11
- package/web/apps/web/.next/server/pages/terminal/pages-manifest.json +0 -3
- package/web/apps/web/.next/server/pages/terminal/react-loadable-manifest.json +0 -1
- package/web/apps/web/.next/server/pages/terminal.html +0 -1
- package/web/apps/web/.next/server/pages/terminal.js.map +0 -5
- package/web/apps/web/.next/server/pages/terminal.js.nft.json +0 -1
- package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/lib/cjs/index.js +0 -176
- package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/lib/cjs/package.json +0 -4
- package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/package.json +0 -28
- package/web/node_modules/.bun/accepts@1.3.8/node_modules/accepts/index.js +0 -238
- package/web/node_modules/.bun/accepts@1.3.8/node_modules/accepts/package.json +0 -47
- package/web/node_modules/.bun/base64id@2.0.0/node_modules/base64id/lib/base64id.js +0 -103
- package/web/node_modules/.bun/base64id@2.0.0/node_modules/base64id/package.json +0 -13
- package/web/node_modules/.bun/cookie@0.7.2/node_modules/cookie/index.js +0 -335
- package/web/node_modules/.bun/cookie@0.7.2/node_modules/cookie/package.json +0 -44
- package/web/node_modules/.bun/cookie@1.1.1/node_modules/cookie/package.json +0 -47
- package/web/node_modules/.bun/cors@2.8.5/node_modules/cors/lib/index.js +0 -238
- package/web/node_modules/.bun/cors@2.8.5/node_modules/cors/package.json +0 -41
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/package.json +0 -60
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/browser.js +0 -271
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/common.js +0 -274
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/index.js +0 -10
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/node.js +0 -263
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/commons.js +0 -19
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -59
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -38
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/index.js +0 -164
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/package.json +0 -8
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/package.json +0 -46
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/engine.io.js +0 -54
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/parser-v3/index.js +0 -424
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/parser-v3/utf8.js +0 -187
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/server.js +0 -786
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/socket.js +0 -460
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transport.js +0 -117
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/index.js +0 -23
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/polling-jsonp.js +0 -41
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/polling.js +0 -332
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/websocket.js +0 -94
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/webtransport.js +0 -63
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/index.js +0 -8
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/polling.js +0 -364
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/websocket.js +0 -73
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/userver.js +0 -279
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/package.json +0 -70
- package/web/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js +0 -8
- package/web/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/package.json +0 -46
- package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/db.json +0 -8519
- package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/index.js +0 -12
- package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/package.json +0 -60
- package/web/node_modules/.bun/mime-types@2.1.35/node_modules/mime-types/index.js +0 -188
- package/web/node_modules/.bun/mime-types@2.1.35/node_modules/mime-types/package.json +0 -44
- package/web/node_modules/.bun/ms@2.1.3/node_modules/ms/index.js +0 -162
- package/web/node_modules/.bun/ms@2.1.3/node_modules/ms/package.json +0 -38
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/index.js +0 -82
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/charset.js +0 -169
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/encoding.js +0 -184
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/language.js +0 -179
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/mediaType.js +0 -294
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/package.json +0 -42
- package/web/node_modules/.bun/object-assign@4.1.1/node_modules/object-assign/index.js +0 -90
- package/web/node_modules/.bun/object-assign@4.1.1/node_modules/object-assign/package.json +0 -42
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/cluster-adapter.js +0 -674
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/contrib/yeast.js +0 -55
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/in-memory-adapter.js +0 -394
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/index.js +0 -10
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/package.json +0 -39
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/binary.js +0 -88
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/index.js +0 -321
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -55
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/package.json +0 -3
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/package.json +0 -58
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.esm.min.js +0 -7
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.js +0 -4908
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.min.js +0 -7
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.msgpack.min.js +0 -7
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/broadcast-operator.js +0 -436
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/client.js +0 -268
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/index.js +0 -804
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/namespace.js +0 -581
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/parent-namespace.js +0 -88
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/socket-types.js +0 -11
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/socket.js +0 -977
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/typed-events.js +0 -81
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/uws.js +0 -136
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/package.json +0 -85
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/wrapper.mjs +0 -3
- package/web/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js +0 -135
- package/web/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/package.json +0 -53
- package/web/node_modules/.bun/vary@1.1.2/node_modules/vary/index.js +0 -149
- package/web/node_modules/.bun/vary@1.1.2/node_modules/vary/package.json +0 -43
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/index.js +0 -13
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/buffer-util.js +0 -131
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/constants.js +0 -12
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/event-target.js +0 -292
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/extension.js +0 -203
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/limiter.js +0 -55
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/permessage-deflate.js +0 -514
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/receiver.js +0 -704
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/sender.js +0 -497
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/stream.js +0 -159
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/subprotocol.js +0 -62
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/validation.js +0 -130
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/websocket-server.js +0 -540
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/websocket.js +0 -1338
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/package.json +0 -69
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/buffer-util.js +0 -131
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/constants.js +0 -18
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/event-target.js +0 -292
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/extension.js +0 -203
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/limiter.js +0 -55
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/receiver.js +0 -706
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/sender.js +0 -602
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/stream.js +0 -161
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/subprotocol.js +0 -62
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/validation.js +0 -152
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/websocket-server.js +0 -550
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/websocket.js +0 -1388
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/package.json +0 -69
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/wrapper.mjs +0 -8
- /package/web/.next/static/{A7pW-dtFIbPCSkvE8uenX → Im7EdK1Q3oOmTznohTOr5}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{A7pW-dtFIbPCSkvE8uenX → Im7EdK1Q3oOmTznohTOr5}/_ssgManifest.js +0 -0
package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/polling.js
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Polling = void 0;
|
|
4
|
-
const transport_1 = require("../transport");
|
|
5
|
-
const zlib_1 = require("zlib");
|
|
6
|
-
const accepts = require("accepts");
|
|
7
|
-
const debug_1 = require("debug");
|
|
8
|
-
const debug = (0, debug_1.default)("engine:polling");
|
|
9
|
-
const compressionMethods = {
|
|
10
|
-
gzip: zlib_1.createGzip,
|
|
11
|
-
deflate: zlib_1.createDeflate,
|
|
12
|
-
};
|
|
13
|
-
class Polling extends transport_1.Transport {
|
|
14
|
-
/**
|
|
15
|
-
* HTTP polling constructor.
|
|
16
|
-
*/
|
|
17
|
-
constructor(req) {
|
|
18
|
-
super(req);
|
|
19
|
-
this.closeTimeout = 30 * 1000;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Transport name
|
|
23
|
-
*/
|
|
24
|
-
get name() {
|
|
25
|
-
return "polling";
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Overrides onRequest.
|
|
29
|
-
*
|
|
30
|
-
* @param {EngineRequest} req
|
|
31
|
-
* @package
|
|
32
|
-
*/
|
|
33
|
-
onRequest(req) {
|
|
34
|
-
const res = req.res;
|
|
35
|
-
// remove the reference to the ServerResponse object (as the first request of the session is kept in memory by default)
|
|
36
|
-
req.res = null;
|
|
37
|
-
if ("GET" === req.method) {
|
|
38
|
-
this.onPollRequest(req, res);
|
|
39
|
-
}
|
|
40
|
-
else if ("POST" === req.method) {
|
|
41
|
-
this.onDataRequest(req, res);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
res.writeHead(500);
|
|
45
|
-
res.end();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The client sends a request awaiting for us to send data.
|
|
50
|
-
*
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
onPollRequest(req, res) {
|
|
54
|
-
if (this.req) {
|
|
55
|
-
debug("request overlap");
|
|
56
|
-
// assert: this.res, '.req and .res should be (un)set together'
|
|
57
|
-
this.onError("overlap from client");
|
|
58
|
-
res.writeHead(400);
|
|
59
|
-
res.end();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
debug("setting request");
|
|
63
|
-
this.req = req;
|
|
64
|
-
this.res = res;
|
|
65
|
-
const onClose = () => {
|
|
66
|
-
this.onError("poll connection closed prematurely");
|
|
67
|
-
};
|
|
68
|
-
const cleanup = () => {
|
|
69
|
-
req.removeListener("close", onClose);
|
|
70
|
-
this.req = this.res = null;
|
|
71
|
-
};
|
|
72
|
-
req.cleanup = cleanup;
|
|
73
|
-
req.on("close", onClose);
|
|
74
|
-
this.writable = true;
|
|
75
|
-
this.emit("ready");
|
|
76
|
-
// if we're still writable but had a pending close, trigger an empty send
|
|
77
|
-
if (this.writable && this.shouldClose) {
|
|
78
|
-
debug("triggering empty send to append close packet");
|
|
79
|
-
this.send([{ type: "noop" }]);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The client sends a request with data.
|
|
84
|
-
*
|
|
85
|
-
* @private
|
|
86
|
-
*/
|
|
87
|
-
onDataRequest(req, res) {
|
|
88
|
-
if (this.dataReq) {
|
|
89
|
-
// assert: this.dataRes, '.dataReq and .dataRes should be (un)set together'
|
|
90
|
-
this.onError("data request overlap from client");
|
|
91
|
-
res.writeHead(400);
|
|
92
|
-
res.end();
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const isBinary = "application/octet-stream" === req.headers["content-type"];
|
|
96
|
-
if (isBinary && this.protocol === 4) {
|
|
97
|
-
return this.onError("invalid content");
|
|
98
|
-
}
|
|
99
|
-
this.dataReq = req;
|
|
100
|
-
this.dataRes = res;
|
|
101
|
-
let chunks = isBinary ? Buffer.concat([]) : "";
|
|
102
|
-
const cleanup = () => {
|
|
103
|
-
req.removeListener("data", onData);
|
|
104
|
-
req.removeListener("end", onEnd);
|
|
105
|
-
req.removeListener("close", onClose);
|
|
106
|
-
this.dataReq = this.dataRes = chunks = null;
|
|
107
|
-
};
|
|
108
|
-
const onClose = () => {
|
|
109
|
-
cleanup();
|
|
110
|
-
this.onError("data request connection closed prematurely");
|
|
111
|
-
};
|
|
112
|
-
const onData = (data) => {
|
|
113
|
-
let contentLength;
|
|
114
|
-
if (isBinary) {
|
|
115
|
-
chunks = Buffer.concat([chunks, data]);
|
|
116
|
-
contentLength = chunks.length;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
chunks += data;
|
|
120
|
-
contentLength = Buffer.byteLength(chunks);
|
|
121
|
-
}
|
|
122
|
-
if (contentLength > this.maxHttpBufferSize) {
|
|
123
|
-
res.writeHead(413).end();
|
|
124
|
-
cleanup();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
const onEnd = () => {
|
|
128
|
-
this.onData(chunks);
|
|
129
|
-
const headers = {
|
|
130
|
-
// text/html is required instead of text/plain to avoid an
|
|
131
|
-
// unwanted download dialog on certain user-agents (GH-43)
|
|
132
|
-
"Content-Type": "text/html",
|
|
133
|
-
"Content-Length": "2",
|
|
134
|
-
};
|
|
135
|
-
res.writeHead(200, this.headers(req, headers));
|
|
136
|
-
res.end("ok");
|
|
137
|
-
cleanup();
|
|
138
|
-
};
|
|
139
|
-
req.on("close", onClose);
|
|
140
|
-
if (!isBinary)
|
|
141
|
-
req.setEncoding("utf8");
|
|
142
|
-
req.on("data", onData);
|
|
143
|
-
req.on("end", onEnd);
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Processes the incoming data payload.
|
|
147
|
-
*
|
|
148
|
-
* @param data - encoded payload
|
|
149
|
-
* @protected
|
|
150
|
-
*/
|
|
151
|
-
onData(data) {
|
|
152
|
-
debug('received "%s"', data);
|
|
153
|
-
const callback = (packet) => {
|
|
154
|
-
if ("close" === packet.type) {
|
|
155
|
-
debug("got xhr close packet");
|
|
156
|
-
this.onClose();
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
this.onPacket(packet);
|
|
160
|
-
};
|
|
161
|
-
if (this.protocol === 3) {
|
|
162
|
-
this.parser.decodePayload(data, callback);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
this.parser.decodePayload(data).forEach(callback);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Overrides onClose.
|
|
170
|
-
*
|
|
171
|
-
* @private
|
|
172
|
-
*/
|
|
173
|
-
onClose() {
|
|
174
|
-
if (this.writable) {
|
|
175
|
-
// close pending poll request
|
|
176
|
-
this.send([{ type: "noop" }]);
|
|
177
|
-
}
|
|
178
|
-
super.onClose();
|
|
179
|
-
}
|
|
180
|
-
send(packets) {
|
|
181
|
-
this.writable = false;
|
|
182
|
-
if (this.shouldClose) {
|
|
183
|
-
debug("appending close packet to payload");
|
|
184
|
-
packets.push({ type: "close" });
|
|
185
|
-
this.shouldClose();
|
|
186
|
-
this.shouldClose = null;
|
|
187
|
-
}
|
|
188
|
-
const doWrite = (data) => {
|
|
189
|
-
const compress = packets.some((packet) => {
|
|
190
|
-
return packet.options && packet.options.compress;
|
|
191
|
-
});
|
|
192
|
-
this.write(data, { compress });
|
|
193
|
-
};
|
|
194
|
-
if (this.protocol === 3) {
|
|
195
|
-
this.parser.encodePayload(packets, this.supportsBinary, doWrite);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
this.parser.encodePayload(packets, doWrite);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Writes data as response to poll request.
|
|
203
|
-
*
|
|
204
|
-
* @param {String} data
|
|
205
|
-
* @param {Object} options
|
|
206
|
-
* @private
|
|
207
|
-
*/
|
|
208
|
-
write(data, options) {
|
|
209
|
-
debug('writing "%s"', data);
|
|
210
|
-
this.doWrite(data, options, () => {
|
|
211
|
-
this.req.cleanup();
|
|
212
|
-
this.emit("drain");
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Performs the write.
|
|
217
|
-
*
|
|
218
|
-
* @protected
|
|
219
|
-
*/
|
|
220
|
-
doWrite(data, options, callback) {
|
|
221
|
-
// explicit UTF-8 is required for pages not served under utf
|
|
222
|
-
const isString = typeof data === "string";
|
|
223
|
-
const contentType = isString
|
|
224
|
-
? "text/plain; charset=UTF-8"
|
|
225
|
-
: "application/octet-stream";
|
|
226
|
-
const headers = {
|
|
227
|
-
"Content-Type": contentType,
|
|
228
|
-
};
|
|
229
|
-
const respond = (data) => {
|
|
230
|
-
headers["Content-Length"] =
|
|
231
|
-
"string" === typeof data ? Buffer.byteLength(data) : data.length;
|
|
232
|
-
this.res.writeHead(200, this.headers(this.req, headers));
|
|
233
|
-
this.res.end(data);
|
|
234
|
-
callback();
|
|
235
|
-
};
|
|
236
|
-
if (!this.httpCompression || !options.compress) {
|
|
237
|
-
respond(data);
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
const len = isString ? Buffer.byteLength(data) : data.length;
|
|
241
|
-
if (len < this.httpCompression.threshold) {
|
|
242
|
-
respond(data);
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const encoding = accepts(this.req).encodings(["gzip", "deflate"]);
|
|
246
|
-
if (!encoding) {
|
|
247
|
-
respond(data);
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
this.compress(data, encoding, (err, data) => {
|
|
251
|
-
if (err) {
|
|
252
|
-
this.res.writeHead(500);
|
|
253
|
-
this.res.end();
|
|
254
|
-
callback(err);
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
headers["Content-Encoding"] = encoding;
|
|
258
|
-
respond(data);
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Compresses data.
|
|
263
|
-
*
|
|
264
|
-
* @private
|
|
265
|
-
*/
|
|
266
|
-
compress(data, encoding, callback) {
|
|
267
|
-
debug("compressing");
|
|
268
|
-
const buffers = [];
|
|
269
|
-
let nread = 0;
|
|
270
|
-
compressionMethods[encoding](this.httpCompression)
|
|
271
|
-
.on("error", callback)
|
|
272
|
-
.on("data", function (chunk) {
|
|
273
|
-
buffers.push(chunk);
|
|
274
|
-
nread += chunk.length;
|
|
275
|
-
})
|
|
276
|
-
.on("end", function () {
|
|
277
|
-
callback(null, Buffer.concat(buffers, nread));
|
|
278
|
-
})
|
|
279
|
-
.end(data);
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Closes the transport.
|
|
283
|
-
*
|
|
284
|
-
* @private
|
|
285
|
-
*/
|
|
286
|
-
doClose(fn) {
|
|
287
|
-
debug("closing");
|
|
288
|
-
let closeTimeoutTimer;
|
|
289
|
-
if (this.dataReq) {
|
|
290
|
-
debug("aborting ongoing data request");
|
|
291
|
-
this.dataReq.destroy();
|
|
292
|
-
}
|
|
293
|
-
const onClose = () => {
|
|
294
|
-
clearTimeout(closeTimeoutTimer);
|
|
295
|
-
fn();
|
|
296
|
-
this.onClose();
|
|
297
|
-
};
|
|
298
|
-
if (this.writable) {
|
|
299
|
-
debug("transport writable - closing right away");
|
|
300
|
-
this.send([{ type: "close" }]);
|
|
301
|
-
onClose();
|
|
302
|
-
}
|
|
303
|
-
else if (this.discarded) {
|
|
304
|
-
debug("transport discarded - closing right away");
|
|
305
|
-
onClose();
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
debug("transport not writable - buffering orderly close");
|
|
309
|
-
this.shouldClose = onClose;
|
|
310
|
-
closeTimeoutTimer = setTimeout(onClose, this.closeTimeout);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Returns headers for a response.
|
|
315
|
-
*
|
|
316
|
-
* @param {http.IncomingMessage} req
|
|
317
|
-
* @param {Object} headers - extra headers
|
|
318
|
-
* @private
|
|
319
|
-
*/
|
|
320
|
-
headers(req, headers = {}) {
|
|
321
|
-
// prevent XSS warnings on IE
|
|
322
|
-
// https://github.com/LearnBoost/socket.io/pull/1333
|
|
323
|
-
const ua = req.headers["user-agent"];
|
|
324
|
-
if (ua && (~ua.indexOf(";MSIE") || ~ua.indexOf("Trident/"))) {
|
|
325
|
-
headers["X-XSS-Protection"] = "0";
|
|
326
|
-
}
|
|
327
|
-
headers["cache-control"] = "no-store";
|
|
328
|
-
this.emit("headers", headers, req);
|
|
329
|
-
return headers;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
exports.Polling = Polling;
|
package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/websocket.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebSocket = void 0;
|
|
4
|
-
const transport_1 = require("../transport");
|
|
5
|
-
const debug_1 = require("debug");
|
|
6
|
-
const debug = (0, debug_1.default)("engine:ws");
|
|
7
|
-
class WebSocket extends transport_1.Transport {
|
|
8
|
-
/**
|
|
9
|
-
* WebSocket transport
|
|
10
|
-
*
|
|
11
|
-
* @param {EngineRequest} req
|
|
12
|
-
*/
|
|
13
|
-
constructor(req) {
|
|
14
|
-
super(req);
|
|
15
|
-
this._doSend = (data) => {
|
|
16
|
-
this.socket.send(data, this._onSent);
|
|
17
|
-
};
|
|
18
|
-
this._doSendLast = (data) => {
|
|
19
|
-
this.socket.send(data, this._onSentLast);
|
|
20
|
-
};
|
|
21
|
-
this._onSent = (err) => {
|
|
22
|
-
if (err) {
|
|
23
|
-
this.onError("write error", err.stack);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
this._onSentLast = (err) => {
|
|
27
|
-
if (err) {
|
|
28
|
-
this.onError("write error", err.stack);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
this.emit("drain");
|
|
32
|
-
this.writable = true;
|
|
33
|
-
this.emit("ready");
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
this.socket = req.websocket;
|
|
37
|
-
this.socket.on("message", (data, isBinary) => {
|
|
38
|
-
const message = isBinary ? data : data.toString();
|
|
39
|
-
debug('received "%s"', message);
|
|
40
|
-
super.onData(message);
|
|
41
|
-
});
|
|
42
|
-
this.socket.once("close", this.onClose.bind(this));
|
|
43
|
-
this.socket.on("error", this.onError.bind(this));
|
|
44
|
-
this.writable = true;
|
|
45
|
-
this.perMessageDeflate = null;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Transport name
|
|
49
|
-
*/
|
|
50
|
-
get name() {
|
|
51
|
-
return "websocket";
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Advertise upgrade support.
|
|
55
|
-
*/
|
|
56
|
-
get handlesUpgrades() {
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
send(packets) {
|
|
60
|
-
this.writable = false;
|
|
61
|
-
for (let i = 0; i < packets.length; i++) {
|
|
62
|
-
const packet = packets[i];
|
|
63
|
-
const isLast = i + 1 === packets.length;
|
|
64
|
-
if (this._canSendPreEncodedFrame(packet)) {
|
|
65
|
-
// the WebSocket frame was computed with WebSocket.Sender.frame()
|
|
66
|
-
// see https://github.com/websockets/ws/issues/617#issuecomment-283002469
|
|
67
|
-
this.socket._sender.sendFrame(
|
|
68
|
-
// @ts-ignore
|
|
69
|
-
packet.options.wsPreEncodedFrame, isLast ? this._onSentLast : this._onSent);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this.parser.encodePacket(packet, this.supportsBinary, isLast ? this._doSendLast : this._doSend);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Whether the encoding of the WebSocket frame can be skipped.
|
|
78
|
-
* @param packet
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
_canSendPreEncodedFrame(packet) {
|
|
82
|
-
var _a, _b, _c;
|
|
83
|
-
return (!this.perMessageDeflate &&
|
|
84
|
-
typeof ((_b = (_a = this.socket) === null || _a === void 0 ? void 0 : _a._sender) === null || _b === void 0 ? void 0 : _b.sendFrame) === "function" &&
|
|
85
|
-
// @ts-ignore
|
|
86
|
-
((_c = packet.options) === null || _c === void 0 ? void 0 : _c.wsPreEncodedFrame) !== undefined);
|
|
87
|
-
}
|
|
88
|
-
doClose(fn) {
|
|
89
|
-
debug("closing");
|
|
90
|
-
this.socket.close();
|
|
91
|
-
fn && fn();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.WebSocket = WebSocket;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebTransport = void 0;
|
|
4
|
-
const transport_1 = require("../transport");
|
|
5
|
-
const debug_1 = require("debug");
|
|
6
|
-
const engine_io_parser_1 = require("engine.io-parser");
|
|
7
|
-
const debug = (0, debug_1.default)("engine:webtransport");
|
|
8
|
-
/**
|
|
9
|
-
* Reference: https://developer.mozilla.org/en-US/docs/Web/API/WebTransport_API
|
|
10
|
-
*/
|
|
11
|
-
class WebTransport extends transport_1.Transport {
|
|
12
|
-
constructor(session, stream, reader) {
|
|
13
|
-
super({ _query: { EIO: "4" } });
|
|
14
|
-
this.session = session;
|
|
15
|
-
const transformStream = (0, engine_io_parser_1.createPacketEncoderStream)();
|
|
16
|
-
transformStream.readable.pipeTo(stream.writable).catch(() => {
|
|
17
|
-
debug("the stream was closed");
|
|
18
|
-
});
|
|
19
|
-
this.writer = transformStream.writable.getWriter();
|
|
20
|
-
(async () => {
|
|
21
|
-
try {
|
|
22
|
-
while (true) {
|
|
23
|
-
const { value, done } = await reader.read();
|
|
24
|
-
if (done) {
|
|
25
|
-
debug("session is closed");
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
debug("received chunk: %o", value);
|
|
29
|
-
this.onPacket(value);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
debug("error while reading: %s", e.message);
|
|
34
|
-
}
|
|
35
|
-
})();
|
|
36
|
-
session.closed.then(() => this.onClose());
|
|
37
|
-
this.writable = true;
|
|
38
|
-
}
|
|
39
|
-
get name() {
|
|
40
|
-
return "webtransport";
|
|
41
|
-
}
|
|
42
|
-
async send(packets) {
|
|
43
|
-
this.writable = false;
|
|
44
|
-
try {
|
|
45
|
-
for (let i = 0; i < packets.length; i++) {
|
|
46
|
-
const packet = packets[i];
|
|
47
|
-
await this.writer.write(packet);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
debug("error while writing: %s", e.message);
|
|
52
|
-
}
|
|
53
|
-
this.emit("drain");
|
|
54
|
-
this.writable = true;
|
|
55
|
-
this.emit("ready");
|
|
56
|
-
}
|
|
57
|
-
doClose(fn) {
|
|
58
|
-
debug("closing WebTransport session");
|
|
59
|
-
this.session.close();
|
|
60
|
-
fn && fn();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.WebTransport = WebTransport;
|