lightclaw2 0.0.1
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 +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/src/channel.d.ts +11 -0
- package/dist/src/channel.d.ts.map +1 -0
- package/dist/src/channel.js +255 -0
- package/dist/src/channel.js.map +1 -0
- package/dist/src/config.d.ts +29 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +99 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/dedup.d.ts +7 -0
- package/dist/src/dedup.d.ts.map +1 -0
- package/dist/src/dedup.js +52 -0
- package/dist/src/dedup.js.map +1 -0
- package/dist/src/gateway.d.ts +16 -0
- package/dist/src/gateway.d.ts.map +1 -0
- package/dist/src/gateway.js +283 -0
- package/dist/src/gateway.js.map +1 -0
- package/dist/src/inbound.d.ts +18 -0
- package/dist/src/inbound.d.ts.map +1 -0
- package/dist/src/inbound.js +252 -0
- package/dist/src/inbound.js.map +1 -0
- package/dist/src/media.d.ts +12 -0
- package/dist/src/media.d.ts.map +1 -0
- package/dist/src/media.js +87 -0
- package/dist/src/media.js.map +1 -0
- package/dist/src/outbound.d.ts +28 -0
- package/dist/src/outbound.d.ts.map +1 -0
- package/dist/src/outbound.js +172 -0
- package/dist/src/outbound.js.map +1 -0
- package/dist/src/runtime.d.ts +4 -0
- package/dist/src/runtime.d.ts.map +1 -0
- package/dist/src/runtime.js +11 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/session-history.d.ts +88 -0
- package/dist/src/session-history.d.ts.map +1 -0
- package/dist/src/session-history.js +545 -0
- package/dist/src/session-history.js.map +1 -0
- package/dist/src/socket-handlers.d.ts +21 -0
- package/dist/src/socket-handlers.d.ts.map +1 -0
- package/dist/src/socket-handlers.js +120 -0
- package/dist/src/socket-handlers.js.map +1 -0
- package/dist/src/socket-registry.d.ts +53 -0
- package/dist/src/socket-registry.d.ts.map +1 -0
- package/dist/src/socket-registry.js +115 -0
- package/dist/src/socket-registry.js.map +1 -0
- package/dist/src/types.d.ts +100 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +10 -0
- package/dist/src/types.js.map +1 -0
- package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
- package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/package.json +28 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/engine.io-client/LICENSE +22 -0
- package/node_modules/engine.io-client/README.md +331 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
- package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/index.js +32 -0
- package/node_modules/engine.io-client/build/cjs/package.json +10 -0
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/cjs/socket.js +765 -0
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +44 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +68 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
- package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/cjs/util.js +65 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/index.js +15 -0
- package/node_modules/engine.io-client/build/esm/package.json +10 -0
- package/node_modules/engine.io-client/build/esm/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm/socket.js +727 -0
- package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm/transport.js +142 -0
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
- package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm/util.js +59 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/index.js +15 -0
- package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.js +756 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.js +3064 -0
- package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
- package/node_modules/engine.io-client/node_modules/ws/LICENSE +20 -0
- package/node_modules/engine.io-client/node_modules/ws/README.md +548 -0
- package/node_modules/engine.io-client/node_modules/ws/browser.js +8 -0
- package/node_modules/engine.io-client/node_modules/ws/index.js +13 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/constants.js +18 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js +550 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/websocket.js +1388 -0
- package/node_modules/engine.io-client/node_modules/ws/package.json +69 -0
- package/node_modules/engine.io-client/node_modules/ws/wrapper.mjs +8 -0
- package/node_modules/engine.io-client/package.json +95 -0
- package/node_modules/engine.io-parser/LICENSE +22 -0
- package/node_modules/engine.io-parser/Readme.md +158 -0
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
- package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
- package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/esm/index.js +156 -0
- package/node_modules/engine.io-parser/build/esm/package.json +8 -0
- package/node_modules/engine.io-parser/package.json +46 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/socket.io-client/LICENSE +21 -0
- package/node_modules/socket.io-client/README.md +29 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/cjs/index.js +76 -0
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
- package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/on.js +9 -0
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/cjs/socket.js +909 -0
- package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/cjs/url.js +69 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm/manager.js +367 -0
- package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/on.js +6 -0
- package/node_modules/socket.io-client/build/esm/package.json +5 -0
- package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm/socket.js +880 -0
- package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm/url.js +59 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
- package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.js +902 -0
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.js +4955 -0
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
- package/node_modules/socket.io-client/package.json +101 -0
- package/node_modules/socket.io-parser/LICENSE +20 -0
- package/node_modules/socket.io-parser/Readme.md +81 -0
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/cjs/binary.js +87 -0
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/cjs/index.js +359 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +54 -0
- package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm/index.js +348 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.js +353 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
- package/node_modules/socket.io-parser/package.json +44 -0
- package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
- package/node_modules/xmlhttprequest-ssl/README.md +67 -0
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
- package/node_modules/xmlhttprequest-ssl/package.json +40 -0
- package/openclaw.plugin.json +17 -0
- package/package.json +61 -0
- package/skills/lightclaw-cron/SKILL.md +381 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const zlib = require('zlib');
|
|
4
|
+
|
|
5
|
+
const bufferUtil = require('./buffer-util');
|
|
6
|
+
const Limiter = require('./limiter');
|
|
7
|
+
const { kStatusCode } = require('./constants');
|
|
8
|
+
|
|
9
|
+
const FastBuffer = Buffer[Symbol.species];
|
|
10
|
+
const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);
|
|
11
|
+
const kPerMessageDeflate = Symbol('permessage-deflate');
|
|
12
|
+
const kTotalLength = Symbol('total-length');
|
|
13
|
+
const kCallback = Symbol('callback');
|
|
14
|
+
const kBuffers = Symbol('buffers');
|
|
15
|
+
const kError = Symbol('error');
|
|
16
|
+
|
|
17
|
+
//
|
|
18
|
+
// We limit zlib concurrency, which prevents severe memory fragmentation
|
|
19
|
+
// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913
|
|
20
|
+
// and https://github.com/websockets/ws/issues/1202
|
|
21
|
+
//
|
|
22
|
+
// Intentionally global; it's the global thread pool that's an issue.
|
|
23
|
+
//
|
|
24
|
+
let zlibLimiter;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* permessage-deflate implementation.
|
|
28
|
+
*/
|
|
29
|
+
class PerMessageDeflate {
|
|
30
|
+
/**
|
|
31
|
+
* Creates a PerMessageDeflate instance.
|
|
32
|
+
*
|
|
33
|
+
* @param {Object} [options] Configuration options
|
|
34
|
+
* @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
|
|
35
|
+
* for, or request, a custom client window size
|
|
36
|
+
* @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
|
|
37
|
+
* acknowledge disabling of client context takeover
|
|
38
|
+
* @param {Number} [options.concurrencyLimit=10] The number of concurrent
|
|
39
|
+
* calls to zlib
|
|
40
|
+
* @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
|
|
41
|
+
* use of a custom server window size
|
|
42
|
+
* @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
|
|
43
|
+
* disabling of server context takeover
|
|
44
|
+
* @param {Number} [options.threshold=1024] Size (in bytes) below which
|
|
45
|
+
* messages should not be compressed if context takeover is disabled
|
|
46
|
+
* @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
|
|
47
|
+
* deflate
|
|
48
|
+
* @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
|
|
49
|
+
* inflate
|
|
50
|
+
* @param {Boolean} [isServer=false] Create the instance in either server or
|
|
51
|
+
* client mode
|
|
52
|
+
* @param {Number} [maxPayload=0] The maximum allowed message length
|
|
53
|
+
*/
|
|
54
|
+
constructor(options, isServer, maxPayload) {
|
|
55
|
+
this._maxPayload = maxPayload | 0;
|
|
56
|
+
this._options = options || {};
|
|
57
|
+
this._threshold =
|
|
58
|
+
this._options.threshold !== undefined ? this._options.threshold : 1024;
|
|
59
|
+
this._isServer = !!isServer;
|
|
60
|
+
this._deflate = null;
|
|
61
|
+
this._inflate = null;
|
|
62
|
+
|
|
63
|
+
this.params = null;
|
|
64
|
+
|
|
65
|
+
if (!zlibLimiter) {
|
|
66
|
+
const concurrency =
|
|
67
|
+
this._options.concurrencyLimit !== undefined
|
|
68
|
+
? this._options.concurrencyLimit
|
|
69
|
+
: 10;
|
|
70
|
+
zlibLimiter = new Limiter(concurrency);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @type {String}
|
|
76
|
+
*/
|
|
77
|
+
static get extensionName() {
|
|
78
|
+
return 'permessage-deflate';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Create an extension negotiation offer.
|
|
83
|
+
*
|
|
84
|
+
* @return {Object} Extension parameters
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
offer() {
|
|
88
|
+
const params = {};
|
|
89
|
+
|
|
90
|
+
if (this._options.serverNoContextTakeover) {
|
|
91
|
+
params.server_no_context_takeover = true;
|
|
92
|
+
}
|
|
93
|
+
if (this._options.clientNoContextTakeover) {
|
|
94
|
+
params.client_no_context_takeover = true;
|
|
95
|
+
}
|
|
96
|
+
if (this._options.serverMaxWindowBits) {
|
|
97
|
+
params.server_max_window_bits = this._options.serverMaxWindowBits;
|
|
98
|
+
}
|
|
99
|
+
if (this._options.clientMaxWindowBits) {
|
|
100
|
+
params.client_max_window_bits = this._options.clientMaxWindowBits;
|
|
101
|
+
} else if (this._options.clientMaxWindowBits == null) {
|
|
102
|
+
params.client_max_window_bits = true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return params;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Accept an extension negotiation offer/response.
|
|
110
|
+
*
|
|
111
|
+
* @param {Array} configurations The extension negotiation offers/reponse
|
|
112
|
+
* @return {Object} Accepted configuration
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
accept(configurations) {
|
|
116
|
+
configurations = this.normalizeParams(configurations);
|
|
117
|
+
|
|
118
|
+
this.params = this._isServer
|
|
119
|
+
? this.acceptAsServer(configurations)
|
|
120
|
+
: this.acceptAsClient(configurations);
|
|
121
|
+
|
|
122
|
+
return this.params;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Releases all resources used by the extension.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
cleanup() {
|
|
131
|
+
if (this._inflate) {
|
|
132
|
+
this._inflate.close();
|
|
133
|
+
this._inflate = null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (this._deflate) {
|
|
137
|
+
const callback = this._deflate[kCallback];
|
|
138
|
+
|
|
139
|
+
this._deflate.close();
|
|
140
|
+
this._deflate = null;
|
|
141
|
+
|
|
142
|
+
if (callback) {
|
|
143
|
+
callback(
|
|
144
|
+
new Error(
|
|
145
|
+
'The deflate stream was closed while data was being processed'
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Accept an extension negotiation offer.
|
|
154
|
+
*
|
|
155
|
+
* @param {Array} offers The extension negotiation offers
|
|
156
|
+
* @return {Object} Accepted configuration
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
acceptAsServer(offers) {
|
|
160
|
+
const opts = this._options;
|
|
161
|
+
const accepted = offers.find((params) => {
|
|
162
|
+
if (
|
|
163
|
+
(opts.serverNoContextTakeover === false &&
|
|
164
|
+
params.server_no_context_takeover) ||
|
|
165
|
+
(params.server_max_window_bits &&
|
|
166
|
+
(opts.serverMaxWindowBits === false ||
|
|
167
|
+
(typeof opts.serverMaxWindowBits === 'number' &&
|
|
168
|
+
opts.serverMaxWindowBits > params.server_max_window_bits))) ||
|
|
169
|
+
(typeof opts.clientMaxWindowBits === 'number' &&
|
|
170
|
+
!params.client_max_window_bits)
|
|
171
|
+
) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return true;
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
if (!accepted) {
|
|
179
|
+
throw new Error('None of the extension offers can be accepted');
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (opts.serverNoContextTakeover) {
|
|
183
|
+
accepted.server_no_context_takeover = true;
|
|
184
|
+
}
|
|
185
|
+
if (opts.clientNoContextTakeover) {
|
|
186
|
+
accepted.client_no_context_takeover = true;
|
|
187
|
+
}
|
|
188
|
+
if (typeof opts.serverMaxWindowBits === 'number') {
|
|
189
|
+
accepted.server_max_window_bits = opts.serverMaxWindowBits;
|
|
190
|
+
}
|
|
191
|
+
if (typeof opts.clientMaxWindowBits === 'number') {
|
|
192
|
+
accepted.client_max_window_bits = opts.clientMaxWindowBits;
|
|
193
|
+
} else if (
|
|
194
|
+
accepted.client_max_window_bits === true ||
|
|
195
|
+
opts.clientMaxWindowBits === false
|
|
196
|
+
) {
|
|
197
|
+
delete accepted.client_max_window_bits;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return accepted;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Accept the extension negotiation response.
|
|
205
|
+
*
|
|
206
|
+
* @param {Array} response The extension negotiation response
|
|
207
|
+
* @return {Object} Accepted configuration
|
|
208
|
+
* @private
|
|
209
|
+
*/
|
|
210
|
+
acceptAsClient(response) {
|
|
211
|
+
const params = response[0];
|
|
212
|
+
|
|
213
|
+
if (
|
|
214
|
+
this._options.clientNoContextTakeover === false &&
|
|
215
|
+
params.client_no_context_takeover
|
|
216
|
+
) {
|
|
217
|
+
throw new Error('Unexpected parameter "client_no_context_takeover"');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (!params.client_max_window_bits) {
|
|
221
|
+
if (typeof this._options.clientMaxWindowBits === 'number') {
|
|
222
|
+
params.client_max_window_bits = this._options.clientMaxWindowBits;
|
|
223
|
+
}
|
|
224
|
+
} else if (
|
|
225
|
+
this._options.clientMaxWindowBits === false ||
|
|
226
|
+
(typeof this._options.clientMaxWindowBits === 'number' &&
|
|
227
|
+
params.client_max_window_bits > this._options.clientMaxWindowBits)
|
|
228
|
+
) {
|
|
229
|
+
throw new Error(
|
|
230
|
+
'Unexpected or invalid parameter "client_max_window_bits"'
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return params;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Normalize parameters.
|
|
239
|
+
*
|
|
240
|
+
* @param {Array} configurations The extension negotiation offers/reponse
|
|
241
|
+
* @return {Array} The offers/response with normalized parameters
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
normalizeParams(configurations) {
|
|
245
|
+
configurations.forEach((params) => {
|
|
246
|
+
Object.keys(params).forEach((key) => {
|
|
247
|
+
let value = params[key];
|
|
248
|
+
|
|
249
|
+
if (value.length > 1) {
|
|
250
|
+
throw new Error(`Parameter "${key}" must have only a single value`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
value = value[0];
|
|
254
|
+
|
|
255
|
+
if (key === 'client_max_window_bits') {
|
|
256
|
+
if (value !== true) {
|
|
257
|
+
const num = +value;
|
|
258
|
+
if (!Number.isInteger(num) || num < 8 || num > 15) {
|
|
259
|
+
throw new TypeError(
|
|
260
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
value = num;
|
|
264
|
+
} else if (!this._isServer) {
|
|
265
|
+
throw new TypeError(
|
|
266
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
} else if (key === 'server_max_window_bits') {
|
|
270
|
+
const num = +value;
|
|
271
|
+
if (!Number.isInteger(num) || num < 8 || num > 15) {
|
|
272
|
+
throw new TypeError(
|
|
273
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
value = num;
|
|
277
|
+
} else if (
|
|
278
|
+
key === 'client_no_context_takeover' ||
|
|
279
|
+
key === 'server_no_context_takeover'
|
|
280
|
+
) {
|
|
281
|
+
if (value !== true) {
|
|
282
|
+
throw new TypeError(
|
|
283
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
throw new Error(`Unknown parameter "${key}"`);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
params[key] = value;
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
return configurations;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Decompress data. Concurrency limited.
|
|
299
|
+
*
|
|
300
|
+
* @param {Buffer} data Compressed data
|
|
301
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
302
|
+
* @param {Function} callback Callback
|
|
303
|
+
* @public
|
|
304
|
+
*/
|
|
305
|
+
decompress(data, fin, callback) {
|
|
306
|
+
zlibLimiter.add((done) => {
|
|
307
|
+
this._decompress(data, fin, (err, result) => {
|
|
308
|
+
done();
|
|
309
|
+
callback(err, result);
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Compress data. Concurrency limited.
|
|
316
|
+
*
|
|
317
|
+
* @param {(Buffer|String)} data Data to compress
|
|
318
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
319
|
+
* @param {Function} callback Callback
|
|
320
|
+
* @public
|
|
321
|
+
*/
|
|
322
|
+
compress(data, fin, callback) {
|
|
323
|
+
zlibLimiter.add((done) => {
|
|
324
|
+
this._compress(data, fin, (err, result) => {
|
|
325
|
+
done();
|
|
326
|
+
callback(err, result);
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Decompress data.
|
|
333
|
+
*
|
|
334
|
+
* @param {Buffer} data Compressed data
|
|
335
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
336
|
+
* @param {Function} callback Callback
|
|
337
|
+
* @private
|
|
338
|
+
*/
|
|
339
|
+
_decompress(data, fin, callback) {
|
|
340
|
+
const endpoint = this._isServer ? 'client' : 'server';
|
|
341
|
+
|
|
342
|
+
if (!this._inflate) {
|
|
343
|
+
const key = `${endpoint}_max_window_bits`;
|
|
344
|
+
const windowBits =
|
|
345
|
+
typeof this.params[key] !== 'number'
|
|
346
|
+
? zlib.Z_DEFAULT_WINDOWBITS
|
|
347
|
+
: this.params[key];
|
|
348
|
+
|
|
349
|
+
this._inflate = zlib.createInflateRaw({
|
|
350
|
+
...this._options.zlibInflateOptions,
|
|
351
|
+
windowBits
|
|
352
|
+
});
|
|
353
|
+
this._inflate[kPerMessageDeflate] = this;
|
|
354
|
+
this._inflate[kTotalLength] = 0;
|
|
355
|
+
this._inflate[kBuffers] = [];
|
|
356
|
+
this._inflate.on('error', inflateOnError);
|
|
357
|
+
this._inflate.on('data', inflateOnData);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
this._inflate[kCallback] = callback;
|
|
361
|
+
|
|
362
|
+
this._inflate.write(data);
|
|
363
|
+
if (fin) this._inflate.write(TRAILER);
|
|
364
|
+
|
|
365
|
+
this._inflate.flush(() => {
|
|
366
|
+
const err = this._inflate[kError];
|
|
367
|
+
|
|
368
|
+
if (err) {
|
|
369
|
+
this._inflate.close();
|
|
370
|
+
this._inflate = null;
|
|
371
|
+
callback(err);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const data = bufferUtil.concat(
|
|
376
|
+
this._inflate[kBuffers],
|
|
377
|
+
this._inflate[kTotalLength]
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
if (this._inflate._readableState.endEmitted) {
|
|
381
|
+
this._inflate.close();
|
|
382
|
+
this._inflate = null;
|
|
383
|
+
} else {
|
|
384
|
+
this._inflate[kTotalLength] = 0;
|
|
385
|
+
this._inflate[kBuffers] = [];
|
|
386
|
+
|
|
387
|
+
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
388
|
+
this._inflate.reset();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
callback(null, data);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Compress data.
|
|
398
|
+
*
|
|
399
|
+
* @param {(Buffer|String)} data Data to compress
|
|
400
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
401
|
+
* @param {Function} callback Callback
|
|
402
|
+
* @private
|
|
403
|
+
*/
|
|
404
|
+
_compress(data, fin, callback) {
|
|
405
|
+
const endpoint = this._isServer ? 'server' : 'client';
|
|
406
|
+
|
|
407
|
+
if (!this._deflate) {
|
|
408
|
+
const key = `${endpoint}_max_window_bits`;
|
|
409
|
+
const windowBits =
|
|
410
|
+
typeof this.params[key] !== 'number'
|
|
411
|
+
? zlib.Z_DEFAULT_WINDOWBITS
|
|
412
|
+
: this.params[key];
|
|
413
|
+
|
|
414
|
+
this._deflate = zlib.createDeflateRaw({
|
|
415
|
+
...this._options.zlibDeflateOptions,
|
|
416
|
+
windowBits
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
this._deflate[kTotalLength] = 0;
|
|
420
|
+
this._deflate[kBuffers] = [];
|
|
421
|
+
|
|
422
|
+
this._deflate.on('data', deflateOnData);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
this._deflate[kCallback] = callback;
|
|
426
|
+
|
|
427
|
+
this._deflate.write(data);
|
|
428
|
+
this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
|
|
429
|
+
if (!this._deflate) {
|
|
430
|
+
//
|
|
431
|
+
// The deflate stream was closed while data was being processed.
|
|
432
|
+
//
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
let data = bufferUtil.concat(
|
|
437
|
+
this._deflate[kBuffers],
|
|
438
|
+
this._deflate[kTotalLength]
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
if (fin) {
|
|
442
|
+
data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
//
|
|
446
|
+
// Ensure that the callback will not be called again in
|
|
447
|
+
// `PerMessageDeflate#cleanup()`.
|
|
448
|
+
//
|
|
449
|
+
this._deflate[kCallback] = null;
|
|
450
|
+
|
|
451
|
+
this._deflate[kTotalLength] = 0;
|
|
452
|
+
this._deflate[kBuffers] = [];
|
|
453
|
+
|
|
454
|
+
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
455
|
+
this._deflate.reset();
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
callback(null, data);
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
module.exports = PerMessageDeflate;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* The listener of the `zlib.DeflateRaw` stream `'data'` event.
|
|
467
|
+
*
|
|
468
|
+
* @param {Buffer} chunk A chunk of data
|
|
469
|
+
* @private
|
|
470
|
+
*/
|
|
471
|
+
function deflateOnData(chunk) {
|
|
472
|
+
this[kBuffers].push(chunk);
|
|
473
|
+
this[kTotalLength] += chunk.length;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* The listener of the `zlib.InflateRaw` stream `'data'` event.
|
|
478
|
+
*
|
|
479
|
+
* @param {Buffer} chunk A chunk of data
|
|
480
|
+
* @private
|
|
481
|
+
*/
|
|
482
|
+
function inflateOnData(chunk) {
|
|
483
|
+
this[kTotalLength] += chunk.length;
|
|
484
|
+
|
|
485
|
+
if (
|
|
486
|
+
this[kPerMessageDeflate]._maxPayload < 1 ||
|
|
487
|
+
this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload
|
|
488
|
+
) {
|
|
489
|
+
this[kBuffers].push(chunk);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
this[kError] = new RangeError('Max payload size exceeded');
|
|
494
|
+
this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';
|
|
495
|
+
this[kError][kStatusCode] = 1009;
|
|
496
|
+
this.removeListener('data', inflateOnData);
|
|
497
|
+
|
|
498
|
+
//
|
|
499
|
+
// The choice to employ `zlib.reset()` over `zlib.close()` is dictated by the
|
|
500
|
+
// fact that in Node.js versions prior to 13.10.0, the callback for
|
|
501
|
+
// `zlib.flush()` is not called if `zlib.close()` is used. Utilizing
|
|
502
|
+
// `zlib.reset()` ensures that either the callback is invoked or an error is
|
|
503
|
+
// emitted.
|
|
504
|
+
//
|
|
505
|
+
this.reset();
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* The listener of the `zlib.InflateRaw` stream `'error'` event.
|
|
510
|
+
*
|
|
511
|
+
* @param {Error} err The emitted error
|
|
512
|
+
* @private
|
|
513
|
+
*/
|
|
514
|
+
function inflateOnError(err) {
|
|
515
|
+
//
|
|
516
|
+
// There is no need to call `Zlib#close()` as the handle is automatically
|
|
517
|
+
// closed when an error is emitted.
|
|
518
|
+
//
|
|
519
|
+
this[kPerMessageDeflate]._inflate = null;
|
|
520
|
+
|
|
521
|
+
if (this[kError]) {
|
|
522
|
+
this[kCallback](this[kError]);
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
err[kStatusCode] = 1007;
|
|
527
|
+
this[kCallback](err);
|
|
528
|
+
}
|