mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-11 16:08:24 -05:00
Compare commits
32 Commits
@socket.io
...
socket.io-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee9aac3134 | ||
|
|
968277cef8 | ||
|
|
2bf16bd214 | ||
|
|
ad616070b8 | ||
|
|
dd71792455 | ||
|
|
bb0b480d2a | ||
|
|
161be91975 | ||
|
|
fd9d4cab5e | ||
|
|
0a99ac44a2 | ||
|
|
4338f47336 | ||
|
|
9199156758 | ||
|
|
594841617d | ||
|
|
84e7253e57 | ||
|
|
30ec4a136a | ||
|
|
e08293bc37 | ||
|
|
b837949479 | ||
|
|
118ef41b94 | ||
|
|
d19928e8d8 | ||
|
|
cdae01983a | ||
|
|
39bb72039d | ||
|
|
98741e15e9 | ||
|
|
8af70195bb | ||
|
|
d88f3f4578 | ||
|
|
f5ee981ee8 | ||
|
|
76e3a72bba | ||
|
|
a7b1938d06 | ||
|
|
54743633ff | ||
|
|
7617707ed8 | ||
|
|
599001d213 | ||
|
|
1c3e4711c1 | ||
|
|
693080cac7 | ||
|
|
5080c73e1e |
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -20,9 +20,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version:
|
||||
- 18
|
||||
- 20
|
||||
- 22.17.1 # experimental TS type striping in 22.18.0 breaks the build
|
||||
- 22
|
||||
- 24
|
||||
|
||||
services:
|
||||
redis:
|
||||
@@ -49,10 +49,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
|
||||
10
.github/workflows/publish.yml
vendored
10
.github/workflows/publish.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# reference: https://docs.npmjs.com/generating-provenance-statements
|
||||
# reference: https://docs.npmjs.com/trusted-publishers#for-github-actions
|
||||
|
||||
name: Publish
|
||||
|
||||
@@ -19,10 +19,10 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js 20
|
||||
- name: Use Node.js 24
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 24
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -32,6 +32,4 @@ jobs:
|
||||
run: npm run compile --workspaces --if-present
|
||||
|
||||
- name: Publish package
|
||||
run: npm publish --workspace=${GITHUB_REF_NAME%@*} --provenance --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: npm publish --workspace=${GITHUB_REF_NAME%@*} --access public
|
||||
|
||||
26
CHANGELOG.md
26
CHANGELOG.md
@@ -2,15 +2,17 @@
|
||||
|
||||
Here are the detailed changelogs for each package in this monorepo:
|
||||
|
||||
| Package | Changelog |
|
||||
|--------------------------------|---------------------------------------------------------|
|
||||
| `engine.io` | [link](packages/engine.io/CHANGELOG.md) |
|
||||
| `engine.io-client` | [link](packages/engine.io-client/CHANGELOG.md) |
|
||||
| `engine.io-parser` | [link](packages/engine.io-parser/CHANGELOG.md) |
|
||||
| `socket.io` | [link](packages/socket.io/CHANGELOG.md) |
|
||||
| `socket.io-adapter` | [link](packages/socket.io-adapter/CHANGELOG.md) |
|
||||
| `socket.io-client` | [link](packages/socket.io-client/CHANGELOG.md) |
|
||||
| `@socket.io/cluster-adapter` | [link](packages/socket.io-cluster-adapter/CHANGELOG.md) |
|
||||
| `@socket.io/cluster-engine` | [link](packages/socket.io-cluster-engine/CHANGELOG.md) |
|
||||
| `@socket.io/component-emitter` | [link](packages/socket.io-component-emitter/History.md) |
|
||||
| `socket.io-parser` | [link](packages/socket.io-parser/CHANGELOG.md) |
|
||||
| Package | Changelog |
|
||||
|------------------------------------|----------------------------------------------------------------|
|
||||
| `engine.io` | [link](packages/engine.io/CHANGELOG.md) |
|
||||
| `engine.io-client` | [link](packages/engine.io-client/CHANGELOG.md) |
|
||||
| `engine.io-parser` | [link](packages/engine.io-parser/CHANGELOG.md) |
|
||||
| `socket.io` | [link](packages/socket.io/CHANGELOG.md) |
|
||||
| `socket.io-adapter` | [link](packages/socket.io-adapter/CHANGELOG.md) |
|
||||
| `socket.io-client` | [link](packages/socket.io-client/CHANGELOG.md) |
|
||||
| `@socket.io/cluster-adapter` | [link](packages/socket.io-cluster-adapter/CHANGELOG.md) |
|
||||
| `@socket.io/cluster-engine` | [link](packages/socket.io-cluster-engine/CHANGELOG.md) |
|
||||
| `@socket.io/component-emitter` | [link](packages/socket.io-component-emitter/History.md) |
|
||||
| `socket.io-parser` | [link](packages/socket.io-parser/CHANGELOG.md) |
|
||||
| `@socket.io/postgres-emitter` | [link](packages/socket.io-postgres-emitter/CHANGELOG.md) |
|
||||
| `@socket.io/redis-streams-emitter` | [link](/packages/socket.io-redis-streams-emitter/CHANGELOG.md) |
|
||||
|
||||
166
package-lock.json
generated
166
package-lock.json
generated
@@ -16,7 +16,8 @@
|
||||
"packages/socket.io-parser",
|
||||
"packages/socket.io-client",
|
||||
"packages/socket.io",
|
||||
"packages/socket.io-postgres-emitter"
|
||||
"packages/socket.io-postgres-emitter",
|
||||
"packages/socket.io-redis-streams-emitter"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.24.7",
|
||||
@@ -31,6 +32,7 @@
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"@socket.io/postgres-adapter": "^0.1.0",
|
||||
"@socket.io/redis-streams-adapter": "~0.2.2",
|
||||
"@types/debug": "^4.1.12",
|
||||
"@types/expect.js": "^0.3.32",
|
||||
"@types/mocha": "^10.0.7",
|
||||
@@ -75,7 +77,7 @@
|
||||
"tsd": "^0.31.1",
|
||||
"tsx": "~4.20.6",
|
||||
"typescript": "^5.5.3",
|
||||
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.48.0",
|
||||
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.56.0",
|
||||
"wdio-geckodriver-service": "^5.0.2"
|
||||
}
|
||||
},
|
||||
@@ -121,6 +123,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz",
|
||||
"integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@ampproject/remapping": "^2.2.0",
|
||||
"@babel/code-frame": "^7.24.7",
|
||||
@@ -2274,25 +2277,27 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@fails-components/webtransport": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@fails-components/webtransport/-/webtransport-1.1.4.tgz",
|
||||
"integrity": "sha512-cFc9XhEREi+afRRl9S9c/xNQ3KVi9dZkaIRVq3xPGwjjezgX5QMQ1pJKG6iZffSwboOOjk1VrDwlvPjuVwtGwQ==",
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@fails-components/webtransport/-/webtransport-1.5.1.tgz",
|
||||
"integrity": "sha512-WB6ZnnunU+pzkl7MtguVCf5K6h7nE7ulHpQMQM+sjZoE77GEtjUfBKSwH0z30fN+H+7caMbXSmPyAOD/WA0QAQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@types/debug": "^4.1.7",
|
||||
"bindings": "^1.5.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.5"
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/@fails-components/webtransport-transport-http3-quiche": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@fails-components/webtransport-transport-http3-quiche/-/webtransport-transport-http3-quiche-1.1.4.tgz",
|
||||
"integrity": "sha512-/tkuAJMSU641c+LrOmHpw8ZtZOQjrHX9O/kg/8iIhnqycNPyFBlzW8EWrmUfSTOran6QmTtQHRks+A1BqMEZeQ==",
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@fails-components/webtransport-transport-http3-quiche/-/webtransport-transport-http3-quiche-1.5.1.tgz",
|
||||
"integrity": "sha512-70FoQURf5KxByC7reVjgGDbRUqbMaFhqkvUc1LisLXw+PD6fIcE7Ua3eAnfsXG3izpV+YNMvucDM2qnCMn8dFg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@types/debug": "^4.1.7",
|
||||
"bindings": "^1.5.0",
|
||||
@@ -2302,7 +2307,7 @@
|
||||
"prebuild-install": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.5"
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/@ioredis/commands": {
|
||||
@@ -2809,6 +2814,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@redis/client/-/client-1.5.17.tgz",
|
||||
"integrity": "sha512-IPvU9A31qRCZ7lds/x+ksuK/UMndd0EASveAvCvEtFFKIZjZ+m/a4a0L7S28KEWoR5ka8526hlSghDo4Hrc2Hg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"cluster-key-slot": "1.1.2",
|
||||
"generic-pool": "3.9.0",
|
||||
@@ -3209,6 +3215,45 @@
|
||||
"resolved": "packages/socket.io-postgres-emitter",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@socket.io/redis-streams-adapter": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@socket.io/redis-streams-adapter/-/redis-streams-adapter-0.2.2.tgz",
|
||||
"integrity": "sha512-BMPa6oGC0wFgpMXoGksbJ75zMBwk+79pxjHc2YusdoK+X0BxN4fTsqEBuFV7yeXi9ekbi87rwlsT61+WZGVW9g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@msgpack/msgpack": "~2.8.0",
|
||||
"debug": "~4.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"socket.io-adapter": "^2.5.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@socket.io/redis-streams-adapter/node_modules/debug": {
|
||||
"version": "4.3.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
|
||||
"integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@socket.io/redis-streams-emitter": {
|
||||
"resolved": "packages/socket.io-redis-streams-emitter",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@szmarczak/http-timer": {
|
||||
"version": "4.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz",
|
||||
@@ -3306,7 +3351,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz",
|
||||
"integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/eslint": "*",
|
||||
"@types/estree": "*"
|
||||
@@ -3395,7 +3439,8 @@
|
||||
"node_modules/@types/node": {
|
||||
"version": "18.15.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz",
|
||||
"integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw=="
|
||||
"integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@types/normalize-package-data": {
|
||||
"version": "2.4.4",
|
||||
@@ -4559,7 +4604,6 @@
|
||||
"integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/helper-numbers": "1.13.2",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.13.2"
|
||||
@@ -4570,24 +4614,21 @@
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz",
|
||||
"integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-api-error": {
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz",
|
||||
"integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-buffer": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz",
|
||||
"integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-numbers": {
|
||||
"version": "1.13.2",
|
||||
@@ -4595,7 +4636,6 @@
|
||||
"integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/floating-point-hex-parser": "1.13.2",
|
||||
"@webassemblyjs/helper-api-error": "1.13.2",
|
||||
@@ -4607,8 +4647,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz",
|
||||
"integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-wasm-section": {
|
||||
"version": "1.14.1",
|
||||
@@ -4616,7 +4655,6 @@
|
||||
"integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-buffer": "1.14.1",
|
||||
@@ -4630,7 +4668,6 @@
|
||||
"integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@xtuc/ieee754": "^1.2.0"
|
||||
}
|
||||
@@ -4641,7 +4678,6 @@
|
||||
"integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@xtuc/long": "4.2.2"
|
||||
}
|
||||
@@ -4651,8 +4687,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz",
|
||||
"integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@webassemblyjs/wasm-edit": {
|
||||
"version": "1.14.1",
|
||||
@@ -4660,7 +4695,6 @@
|
||||
"integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-buffer": "1.14.1",
|
||||
@@ -4678,7 +4712,6 @@
|
||||
"integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.13.2",
|
||||
@@ -4693,7 +4726,6 @@
|
||||
"integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-buffer": "1.14.1",
|
||||
@@ -4707,7 +4739,6 @@
|
||||
"integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-api-error": "1.13.2",
|
||||
@@ -4723,7 +4754,6 @@
|
||||
"integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@xtuc/long": "4.2.2"
|
||||
@@ -4734,16 +4764,14 @@
|
||||
"resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
|
||||
"integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"peer": true
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@xtuc/long": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
|
||||
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/@zip.js/zip.js": {
|
||||
"version": "2.7.45",
|
||||
@@ -4786,6 +4814,7 @@
|
||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -4799,7 +4828,6 @@
|
||||
"integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
},
|
||||
@@ -5914,6 +5942,7 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.8.9",
|
||||
"caniuse-lite": "^1.0.30001746",
|
||||
@@ -6313,7 +6342,6 @@
|
||||
"integrity": "sha512-YclTJey34KUm5jB1aEJCq807bSievi7Nb/TU4Gu504fUYi3jw3KCIaH6L7nFWQhdEgH3V+wCh+kKD1P5cXnfxw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
@@ -6333,7 +6361,6 @@
|
||||
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
@@ -6346,7 +6373,6 @@
|
||||
"resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz",
|
||||
"integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
}
|
||||
@@ -7236,7 +7262,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/node": "^22.2.0",
|
||||
"@wdio/config": "8.46.0",
|
||||
@@ -7262,7 +7287,8 @@
|
||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1400418.tgz",
|
||||
"integrity": "sha512-U8j75zDOXF8IP3o0Cgb7K4tFA9uUHEOru2Wx64+EUqL4LNOh9dRe1i8WKR1k3mSpjcCe3aIkTDvEwq0YkI4hfw==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause"
|
||||
"license": "BSD-3-Clause",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/devtools/node_modules/@types/node": {
|
||||
"version": "22.18.9",
|
||||
@@ -7271,7 +7297,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
}
|
||||
@@ -7283,7 +7308,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/node": "^22.2.0"
|
||||
},
|
||||
@@ -7297,7 +7321,6 @@
|
||||
"integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
@@ -7308,8 +7331,7 @@
|
||||
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/devtools/node_modules/uuid": {
|
||||
"version": "10.0.0",
|
||||
@@ -7322,7 +7344,6 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
@@ -7333,7 +7354,6 @@
|
||||
"integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"isexe": "^3.1.1"
|
||||
},
|
||||
@@ -7721,8 +7741,7 @@
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz",
|
||||
"integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
@@ -7861,7 +7880,6 @@
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esrecurse": "^4.3.0",
|
||||
"estraverse": "^4.1.1"
|
||||
@@ -7884,7 +7902,6 @@
|
||||
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
|
||||
"integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"estraverse": "^5.2.0"
|
||||
},
|
||||
@@ -7897,7 +7914,6 @@
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
|
||||
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
@@ -7907,7 +7923,6 @@
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
||||
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
@@ -9053,8 +9068,7 @@
|
||||
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
|
||||
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"peer": true
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "11.12.0",
|
||||
@@ -9748,7 +9762,6 @@
|
||||
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"is-docker": "cli.js"
|
||||
},
|
||||
@@ -9904,7 +9917,6 @@
|
||||
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"is-docker": "^2.0.0"
|
||||
},
|
||||
@@ -10356,7 +10368,6 @@
|
||||
"integrity": "sha512-ioBrW3s2i97noEmnXxmUq7cjIcVRjT5HBpAYy8zE11CxU9HqlWHHeRxfeN1tn8F7OEMVPIC9x1f8t3Z7US9ehQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"debug": "^2.6.9",
|
||||
"marky": "^1.2.2"
|
||||
@@ -10368,7 +10379,6 @@
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
@@ -10378,8 +10388,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/lines-and-columns": {
|
||||
"version": "1.2.4",
|
||||
@@ -10399,7 +10408,6 @@
|
||||
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz",
|
||||
"integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=6.11.5"
|
||||
}
|
||||
@@ -10639,8 +10647,7 @@
|
||||
"resolved": "https://registry.npmjs.org/marky/-/marky-1.2.5.tgz",
|
||||
"integrity": "sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
@@ -11111,8 +11118,7 @@
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/netmask": {
|
||||
"version": "2.0.2",
|
||||
@@ -11973,6 +11979,7 @@
|
||||
"integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"pg-connection-string": "^2.9.1",
|
||||
"pg-pool": "^3.10.1",
|
||||
@@ -13209,6 +13216,7 @@
|
||||
"integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
},
|
||||
@@ -13362,6 +13370,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz",
|
||||
"integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
@@ -14480,7 +14489,6 @@
|
||||
"integrity": "sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"jest-worker": "^27.4.5",
|
||||
@@ -14516,7 +14524,6 @@
|
||||
"integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"merge-stream": "^2.0.0",
|
||||
@@ -14897,6 +14904,7 @@
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz",
|
||||
"integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@@ -14925,7 +14933,6 @@
|
||||
}
|
||||
],
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
@@ -15152,8 +15159,8 @@
|
||||
}
|
||||
},
|
||||
"node_modules/uWebSockets.js": {
|
||||
"version": "20.48.0",
|
||||
"resolved": "git+ssh://git@github.com/uNetworking/uWebSockets.js.git#51ae1d1fd92dff77cbbdc7c431021f85578da1a6",
|
||||
"version": "20.56.0",
|
||||
"resolved": "git+ssh://git@github.com/uNetworking/uWebSockets.js.git#d04e707a1292928d50163ff7545e45c3e84c5ec3",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
@@ -15213,7 +15220,6 @@
|
||||
"integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.1.2"
|
||||
@@ -15669,7 +15675,6 @@
|
||||
"integrity": "sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
@@ -16115,7 +16120,7 @@
|
||||
},
|
||||
"packages/socket.io-cluster-adapter": {
|
||||
"name": "@socket.io/cluster-adapter",
|
||||
"version": "0.2.2",
|
||||
"version": "0.3.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "~4.4.1"
|
||||
@@ -16177,6 +16182,15 @@
|
||||
"@msgpack/msgpack": "^2.7.0",
|
||||
"debug": "~4.4.1"
|
||||
}
|
||||
},
|
||||
"packages/socket.io-redis-streams-emitter": {
|
||||
"name": "@socket.io/redis-streams-emitter",
|
||||
"version": "0.1.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@msgpack/msgpack": "~2.8.0",
|
||||
"debug": "~4.4.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
"packages/socket.io-parser",
|
||||
"packages/socket.io-client",
|
||||
"packages/socket.io",
|
||||
"packages/socket.io-postgres-emitter"
|
||||
"packages/socket.io-postgres-emitter",
|
||||
"packages/socket.io-redis-streams-emitter"
|
||||
],
|
||||
"overrides": {
|
||||
"@types/estree": "0.0.52",
|
||||
@@ -32,6 +33,7 @@
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"@socket.io/postgres-adapter": "^0.1.0",
|
||||
"@socket.io/redis-streams-adapter": "~0.2.2",
|
||||
"@types/debug": "^4.1.12",
|
||||
"@types/expect.js": "^0.3.32",
|
||||
"@types/mocha": "^10.0.7",
|
||||
@@ -76,7 +78,7 @@
|
||||
"tsd": "^0.31.1",
|
||||
"tsx": "~4.20.6",
|
||||
"typescript": "^5.5.3",
|
||||
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.48.0",
|
||||
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.56.0",
|
||||
"wdio-geckodriver-service": "^5.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# History
|
||||
# Changelog
|
||||
|
||||
| Version | Release date | Bundle size (UMD min+gzip) |
|
||||
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
|
||||
| [6.6.4](#664-2025-12-23) | December 2025 | `8.7 KB` |
|
||||
| [6.6.3](#663-2025-01-23) | January 2025 | `8.7 KB` |
|
||||
| [6.6.2](#662-2024-10-23) | October 2024 | `8.7 KB` |
|
||||
| [6.6.1](#661-2024-09-21) | September 2024 | `8.7 KB` |
|
||||
@@ -39,7 +40,24 @@
|
||||
| [4.1.1](#411-2021-02-02) | February 2021 | `9.1 KB` |
|
||||
| [4.1.0](#410-2021-01-14) | January 2021 | `9.1 KB` |
|
||||
|
||||
# Release notes
|
||||
|
||||
## [6.6.4](https://github.com/socketio/socket.io/compare/engine.io-client@6.6.3...engine.io-client@6.6.4) (2025-12-23)
|
||||
|
||||
This release contains a bump of:
|
||||
|
||||
- `ws` from `~8.17.1` to `~8.18.3`
|
||||
- `debug` from `~4.3.1` to `~4.4.1`
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* properly handle port option ([#5241](https://github.com/socketio/socket.io/issues/5241)) ([1da9cdd](https://github.com/socketio/socket.io/commit/1da9cddeab0bf5ce41890d156d73af8194cef656))
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
- [`ws@~8.18.3`](https://github.com/websockets/ws/releases/tag/8.18.3) ([diff](https://github.com/websockets/ws/compare/8.17.1...8.18.3))
|
||||
|
||||
|
||||
|
||||
## [6.6.3](https://github.com/socketio/socket.io/compare/engine.io-client@6.6.2...engine.io-client@6.6.3) (2025-01-23)
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
172
packages/engine.io-client/dist/engine.io.js
vendored
172
packages/engine.io-client/dist/engine.io.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Engine.IO v6.6.3
|
||||
* Engine.IO v6.6.4
|
||||
* (c) 2014-2025 Guillermo Rauch
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
@@ -35,6 +35,54 @@
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _extends() {
|
||||
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
||||
for (var e = 1; e < arguments.length; e++) {
|
||||
@@ -1049,21 +1097,65 @@
|
||||
createDebug.namespaces = namespaces;
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
var i;
|
||||
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
||||
var len = split.length;
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!split[i]) {
|
||||
// ignore empty strings
|
||||
continue;
|
||||
var split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(/\s+/g, ',').split(',').filter(Boolean);
|
||||
var _iterator = _createForOfIteratorHelper(split),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var ns = _step.value;
|
||||
if (ns[0] === '-') {
|
||||
createDebug.skips.push(ns.slice(1));
|
||||
} else {
|
||||
createDebug.names.push(ns);
|
||||
}
|
||||
}
|
||||
namespaces = split[i].replace(/\*/g, '.*?');
|
||||
if (namespaces[0] === '-') {
|
||||
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given string matches a namespace template, honoring
|
||||
* asterisks as wildcards.
|
||||
*
|
||||
* @param {String} search
|
||||
* @param {String} template
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function matchesTemplate(search, template) {
|
||||
var searchIndex = 0;
|
||||
var templateIndex = 0;
|
||||
var starIndex = -1;
|
||||
var matchIndex = 0;
|
||||
while (searchIndex < search.length) {
|
||||
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
||||
// Match character or proceed with wildcard
|
||||
if (template[templateIndex] === '*') {
|
||||
starIndex = templateIndex;
|
||||
matchIndex = searchIndex;
|
||||
templateIndex++; // Skip the '*'
|
||||
} else {
|
||||
searchIndex++;
|
||||
templateIndex++;
|
||||
}
|
||||
} else if (starIndex !== -1) {
|
||||
// eslint-disable-line no-negated-condition
|
||||
// Backtrack to the last '*' and try to match more characters
|
||||
templateIndex = starIndex + 1;
|
||||
matchIndex++;
|
||||
searchIndex = matchIndex;
|
||||
} else {
|
||||
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
||||
return false; // No match
|
||||
}
|
||||
}
|
||||
|
||||
// Handle trailing '*' in template
|
||||
while (templateIndex < template.length && template[templateIndex] === '*') {
|
||||
templateIndex++;
|
||||
}
|
||||
return templateIndex === template.length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1073,7 +1165,7 @@
|
||||
* @api public
|
||||
*/
|
||||
function disable() {
|
||||
var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
|
||||
var namespaces = [].concat(_toConsumableArray(createDebug.names), _toConsumableArray(createDebug.skips.map(function (namespace) {
|
||||
return '-' + namespace;
|
||||
}))).join(',');
|
||||
createDebug.enable('');
|
||||
@@ -1088,35 +1180,37 @@
|
||||
* @api public
|
||||
*/
|
||||
function enabled(name) {
|
||||
if (name[name.length - 1] === '*') {
|
||||
return true;
|
||||
}
|
||||
var i;
|
||||
var len;
|
||||
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
||||
if (createDebug.skips[i].test(name)) {
|
||||
return false;
|
||||
var _iterator2 = _createForOfIteratorHelper(createDebug.skips),
|
||||
_step2;
|
||||
try {
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
var skip = _step2.value;
|
||||
if (matchesTemplate(name, skip)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
||||
if (createDebug.names[i].test(name)) {
|
||||
return true;
|
||||
var _iterator3 = _createForOfIteratorHelper(createDebug.names),
|
||||
_step3;
|
||||
try {
|
||||
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
||||
var ns = _step3.value;
|
||||
if (matchesTemplate(name, ns)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator3.e(err);
|
||||
} finally {
|
||||
_iterator3.f();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert regexp to namespace
|
||||
*
|
||||
* @param {RegExp} regxep
|
||||
* @return {String} namespace
|
||||
* @api private
|
||||
*/
|
||||
function toNamespace(regexp) {
|
||||
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce `val`.
|
||||
*
|
||||
@@ -1192,15 +1286,17 @@
|
||||
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
||||
return false;
|
||||
}
|
||||
var m;
|
||||
|
||||
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||
// eslint-disable-next-line no-return-assign
|
||||
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
||||
// Is firebug? http://stackoverflow.com/a/398120/376773
|
||||
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
||||
// Is firefox >= v31?
|
||||
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 ||
|
||||
// Double check webkit in userAgent just in case we are in a worker
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
||||
}
|
||||
@@ -1276,7 +1372,7 @@
|
||||
function load() {
|
||||
var r;
|
||||
try {
|
||||
r = exports.storage.getItem('debug');
|
||||
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG');
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
@@ -1457,7 +1553,7 @@
|
||||
return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
|
||||
};
|
||||
_proto._port = function _port() {
|
||||
if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {
|
||||
if (this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80)) {
|
||||
return ":" + this.opts.port;
|
||||
} else {
|
||||
return "";
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
"name": "engine.io-client",
|
||||
"description": "Client for the realtime Engine",
|
||||
"license": "MIT",
|
||||
"version": "6.6.3",
|
||||
"version": "6.6.4",
|
||||
"main": "./build/cjs/index.js",
|
||||
"module": "./build/esm/index.js",
|
||||
"exports": {
|
||||
|
||||
@@ -53,6 +53,26 @@ async function setup(opts, cb) {
|
||||
cb({ engine, h3Server, certificate });
|
||||
}
|
||||
|
||||
function createHttpServer(port) {
|
||||
const httpServer = createServer();
|
||||
|
||||
let retryCount = 0;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
httpServer.listen(port, () => resolve(httpServer));
|
||||
|
||||
httpServer.on("error", (e) => {
|
||||
if (e.code === "EADDRINUSE" && ++retryCount <= 3) {
|
||||
console.warn("port already in use, retrying...");
|
||||
setTimeout(() => {
|
||||
httpServer.listen(port, () => resolve(httpServer));
|
||||
}, 100);
|
||||
}
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function success(engine, h3server, done) {
|
||||
engine.close();
|
||||
h3server.stopServer();
|
||||
@@ -98,10 +118,9 @@ describe("WebTransport", () => {
|
||||
{
|
||||
transports: ["polling", "webtransport"],
|
||||
},
|
||||
({ engine, h3Server, certificate }) => {
|
||||
const httpServer = createServer();
|
||||
async ({ engine, h3Server, certificate }) => {
|
||||
const httpServer = await createHttpServer(h3Server.port);
|
||||
engine.attach(httpServer);
|
||||
httpServer.listen(h3Server.port);
|
||||
|
||||
const socket = createSocket(h3Server.port, certificate, {
|
||||
transports: ["polling", "webtransport"],
|
||||
@@ -120,10 +139,9 @@ describe("WebTransport", () => {
|
||||
{
|
||||
transports: ["polling", "websocket", "webtransport"],
|
||||
},
|
||||
({ engine, h3Server, certificate }) => {
|
||||
const httpServer = createServer();
|
||||
async ({ engine, h3Server, certificate }) => {
|
||||
const httpServer = await createHttpServer(h3Server.port);
|
||||
engine.attach(httpServer);
|
||||
httpServer.listen(h3Server.port);
|
||||
|
||||
const socket = createSocket(h3Server.port, certificate, {
|
||||
transports: ["polling", "websocket", "webtransport"],
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"scripts": {
|
||||
"compile": "rimraf ./build && tsc && tsc -p tsconfig.esm.json && ./postcompile.sh",
|
||||
"test": "npm run format:check && npm run compile && if test \"$BROWSERS\" = \"1\" ; then npm run test:browser; else npm run test:node; fi",
|
||||
"test:node": "nyc mocha -r ts-node/register test/index.ts",
|
||||
"test:node": "nyc mocha --import=tsx test/index.ts",
|
||||
"test:browser": "zuul test/index.ts --no-coverage",
|
||||
"format:check": "prettier --check 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
"format:fix": "prettier --write 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# History
|
||||
# Changelog
|
||||
|
||||
| Version | Release date |
|
||||
|------------------------------------------------------------------------------------------------------|----------------|
|
||||
| [6.6.5](#665-2025-12-22) | December 2025 |
|
||||
| [6.6.4](#664-2025-01-28) | January 2025 |
|
||||
| [6.6.3](#663-2025-01-23) | January 2025 |
|
||||
| [6.6.2](#662-2024-10-09) | October 2024 |
|
||||
@@ -47,7 +48,16 @@
|
||||
| [3.4.1](#341-2020-04-17) | April 2020 |
|
||||
|
||||
|
||||
# Release notes
|
||||
## [6.6.5](https://github.com/socketio/socket.io/compare/engine.io@6.6.4...engine.io@6.6.5) (2025-12-22)
|
||||
|
||||
The `url.parse()` function is now deprecated and has been replaced by `new URL()` (see [e08293b](https://github.com/socketio/socket.io/commit/e08293bc3735de5b824b347383e86e0b8ab9fbd5)).
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
- [`ws@~8.18.3`](https://github.com/websockets/ws/releases/tag/8.18.3) ([diff](https://github.com/websockets/ws/compare/8.17.1...8.18.3))
|
||||
|
||||
|
||||
|
||||
## [6.6.4](https://github.com/socketio/socket.io/compare/engine.io@6.6.3...engine.io@6.6.4) (2025-01-28)
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import * as qs from "querystring";
|
||||
import { parse } from "url";
|
||||
import * as base64id from "base64id";
|
||||
import transports from "./transports";
|
||||
import { EventEmitter } from "events";
|
||||
@@ -736,9 +734,8 @@ export class Server extends BaseServer {
|
||||
private prepare(req: EngineRequest) {
|
||||
// try to leverage pre-existing `req._query` (e.g: from connect)
|
||||
if (!req._query) {
|
||||
req._query = (
|
||||
~req.url.indexOf("?") ? qs.parse(parse(req.url).query) : {}
|
||||
) as Record<string, string>;
|
||||
const url = new URL(req.url, "https://socket.io");
|
||||
req._query = Object.fromEntries(url.searchParams.entries());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "engine.io",
|
||||
"version": "6.6.4",
|
||||
"version": "6.6.5",
|
||||
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
|
||||
"type": "commonjs",
|
||||
"main": "./build/engine.io.js",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
if (process.env.EIO_CLIENT === "3" && process.versions.node.startsWith("22")) {
|
||||
// FIXME WebSocket error with engine.io-client@3
|
||||
if (process.env.EIO_CLIENT === "3") {
|
||||
// we need the WebSocket object provided by the "ws" library to test the SSL certs and HTTP headers so we hide the now built-in WebSocket constructor
|
||||
// ref: https://nodejs.org/api/globals.html#class-websocket
|
||||
global.WebSocket = null;
|
||||
}
|
||||
|
||||
|
||||
48
packages/engine.io/test/fixtures/ca.crt
vendored
48
packages/engine.io/test/fixtures/ca.crt
vendored
@@ -1,33 +1,19 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFtTCCA52gAwIBAgIJAJKBPV3nMXjsMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
|
||||
BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
|
||||
aWRnaXRzIFB0eSBMdGQwHhcNMTUxMTE4MTczODAwWhcNMjUxMTE1MTczODAwWjBF
|
||||
MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50
|
||||
ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
|
||||
CgKCAgEAmNWKTumE1f+ptArhPTOcaUReoqBlri/ujIzm1N8Qr0hghS6B8eXGngAS
|
||||
YM7ziTlLZmLKgZg7TYOs+qK+xNNjSMbkA4Tions7vX3FYAokfh1iSiQigAw3TAwg
|
||||
brUaA0phucJBjvWI2mDuwzTLhQp1wmGrliAJhXag2ZQt817m6wrsFWuwiviMIHlq
|
||||
mQhC+vwd2SvW4xGf5zxjzCM8m7pOiJCLjxXwvNphiTR3tb807W00mi5cMFwhmAUT
|
||||
uSiVkVERubIYEKNSW2ynxzGFfb+GF/ddUxCKsnMDfM+SpMrsTBv9BzJzXU7Hc9jP
|
||||
NPFtrZiVo9aKn8csTSvKifmfiNwl2YGuWlW++1+ew6Q9rqEqvKHnKU+Cuwt3y37U
|
||||
ryqrBS47cz1xxFb3fCn+a72ytcHjI9lMqIQ0+IZ0/4cf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CUsFkn29C0RQQMILbxYkNl08DuSQw68+PsA2YeB4aUikmW5sRHYF
|
||||
TgLXxgZ+aaGH4WtedumD4RGodcFbxI2WLIilKD4nH0FmB4I9bkULgMyyOZ0g+Vc7
|
||||
ekynqzYtzQBgK+HLWtIWZRTM/BR5IAzt/SdAVoQwL3EHzlc57Q9rRqYeBiyse3lC
|
||||
8Ojb9ZLhwv/hihWNd+mFKeWzLAGJIB439AUzKcg96YDKB3Nwosa16g0xslwxvAL/
|
||||
cKJQ3mh7pIOX3iv9YV/uifRvdCiI/e2p00YjZiS3ggdravSGjLLypw6HFH3hFnw7
|
||||
2ZzA88NgFQXi
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
79
packages/engine.io/test/fixtures/ca.key
vendored
79
packages/engine.io/test/fixtures/ca.key
vendored
@@ -1,51 +1,28 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIJKQIBAAKCAgEAmNWKTumE1f+ptArhPTOcaUReoqBlri/ujIzm1N8Qr0hghS6B
|
||||
8eXGngASYM7ziTlLZmLKgZg7TYOs+qK+xNNjSMbkA4Tions7vX3FYAokfh1iSiQi
|
||||
gAw3TAwgbrUaA0phucJBjvWI2mDuwzTLhQp1wmGrliAJhXag2ZQt817m6wrsFWuw
|
||||
iviMIHlqmQhC+vwd2SvW4xGf5zxjzCM8m7pOiJCLjxXwvNphiTR3tb807W00mi5c
|
||||
MFwhmAUTuSiVkVERubIYEKNSW2ynxzGFfb+GF/ddUxCKsnMDfM+SpMrsTBv9BzJz
|
||||
XU7Hc9jPNPFtrZiVo9aKn8csTSvKifmfiNwl2YGuWlW++1+ew6Q9rqEqvKHnKU+C
|
||||
uwt3y37UryqrBS47cz1xxFb3fCn+a72ytcHjI9lMqIQ0+IZ0/4cf0TK80ECEQ0Cy
|
||||
rCk0E9QzeMEzIALRa/pI8uTXdoAtQIlOsfALWeni+QphZ1BVjwZRmr+F1Px2/R30
|
||||
+gAcZHKcD+0Bm6owvpBWDe1s0Drk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BQ9IhMHPg7O8whHMT2s
|
||||
aWxbx6HqxrL0NtkTymuDCC77+/r7o5YrJ75VanHTm0qrc7ObsRfPjqKQr6fBtv9O
|
||||
A+Reuwi0y5AgdYHjiHh20ZXo+GtYeP+T4v23ChC3Vka/3xVJOXrYuk93MX7rqSYf
|
||||
bku/2XRShOFQJwrC2Ih3Li983OJ1PVQb+ugMjp6OIHIt4RfG+2lzqDJ6xt4FP+zO
|
||||
231BUKraReGBozWt+8AKAFwB3pMTQliCdt/n7g/n/imNq18IC6NfN9/cfYE0TRDp
|
||||
rOKPfbwdZD7Nof5X3c0DANsQFI23yvHRAoIBAQCIdbiXKkrgv0fbSNaTpP8XNROV
|
||||
M+BROigjiQnvAILKCenp1MSKcnIfL24ZfWzRhC5s0WtbsABswK+6pP4lXiXZqvyi
|
||||
5SJ3/omT13CyNjTDw1LlpSE33FHJKAIpYfP8QVTkOG/8GclR/JUFXicujess2fhw
|
||||
9F4sUA9txqiyWzhHauU0R4V78jsq1V4VEtGhpapzVNtvpWeCEB33WUiU/EwdLsdz
|
||||
RnKkvCA0WAFuwhH3bELyFj5sVy8L6kS8QQt6w4T2L/gNkwO01RmCNXSQbYkdYA1Y
|
||||
9t8FefPnf1Ry86PLdKyg8/LNLS023MpDgt7eCa2/ysnbhDZ5RepZJymcy0rP
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChKwRqFDrGgqMH
|
||||
jDUx5he6MDQ+BxlMqqpm0qu5pOCCPzSvYDFoiU4n3lK6uCbemv9Gdk/U99ev8LAG
|
||||
g2SkZAZXBpDrdZepkA84ehUHu5u7PHlXNodEKL7DLKsvoaYYiQ5rLyBYieDOYqtY
|
||||
JxtfLOeh+tmnNa+G4chpYzkll7OCeEQhbocQQLdP8novscoSibp6bPmoVsat8RRr
|
||||
u0CK9ND1v+FvJ2R7Lz2isBIr+p9ZrkY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0F+AzwKBgDcB
|
||||
5K9veGPjs65HrKbnGBfNGbjPKka3rNUDze0LRlWYi8/Ox2b/dS3rWIfh1tLfQ2rG
|
||||
R4M2EXke+rGokMcftpOilE3dQ0I+4J/Eu+Wc7YokDQLBpMGHF6wUcbCZ26GRlFWu
|
||||
jmRunLZFHYMA1178r+KJRSQMKNdPFd3moELYJKBhAoGBALAJg2x1B1TpLvJf3iI3
|
||||
BeuASfYKpp3X3cyUy0ojxdYIEHHZ87TINojldHVd+t+80M8FG7YgQNTWtx0Wz587
|
||||
EslppRo2r8qusax9KjaZ1uf04jWxR/v88dvpspSi3IV/J3rNhf3xz1gEFdRXvtQc
|
||||
Ek+aWNHKp5nqpuY6HWUacI96
|
||||
-----END PRIVATE KEY-----
|
||||
|
||||
54
packages/engine.io/test/fixtures/ca.key.org
vendored
54
packages/engine.io/test/fixtures/ca.key.org
vendored
@@ -1,54 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,47A0291BAB679B36
|
||||
|
||||
KuGdIvVLu07u5l1aC/NdXvqLFAbI6NHHosGKs+CuuvnqSd4Yo1XG19SR+irE4vvQ
|
||||
EWwMypyTy0HN81WEvwx5PFNT+PGokjz6KBJsUwYo6pgS9pXfx9hk/Uo5NKSrH3Qm
|
||||
3rBVWciPABUiprJaz5PyYZHX/EdzvDmNUpC3HhO0Q4Bfy3DXp8sPvKaoHXYIreKd
|
||||
SpApbeP3bc2N/mg3qFLPC4tntmo2oYID6PEknrMHgBjvQvRDWHhzISdUTcgYmg2n
|
||||
p7aQa0HUbixFpDfTKjBn808iYa76AFj5gfG1NaIZ839h1jq1DlT3y4wcNxpEXY8Z
|
||||
UMvtAtLSEOZYDgJt7kzTJ7tqNYKPluDEoaljLGZeIOYYKDgU6d3Zs67aL036CVSr
|
||||
YdM3mIl65r196NIYnBeXT0metNMWYEAzuF7xTpaeO5JGDECvKQTYumPWwNjX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wk9fUrY2afDXXOT2G4RJc90i/Vh+7NWNGli
|
||||
gXp2Dd4rbC+M/GAEj6wuycddde6M2dNrvLWce2Eh1IDZZaAEfsJJ0WN+13eUtiZv
|
||||
8cZMb1/HpUy8hrqUw2wuRTWbG1V9PeaBioMBENCn/Zorlh+l2UHuGECCy9aaxhSH
|
||||
ufxp67BCF5RopYjf5QFUsYH1M+DbUO5PqryWhD+wGuQ5Eu8n5Xhrva0ny/VO8Csj
|
||||
2kyFRrgMJStQ66hCj1+cH9rvBqQIrSRcU3zw9iuGYMnAITPvMPNp+hzsY0ttSGlK
|
||||
xk7ZNDN2XaUipED71H9NkzjrdCIarKCQ2VtTzH9L8DKPcSlPAwSCiKhPVaAwSNZs
|
||||
k44ZJSAQTLtUFjDQUNQDkEjnrf/xdZglhLfaOAjlvXyZEv4JC89GUccaRfDUHGJL
|
||||
rbEdfHlD0L2gwHGoRNoYGZA+C161CFlx9lOwNDtOD0nQYhMRHUn69jJIKeJhdK05
|
||||
ZxmrGkqBHQR4agctfeVHUcnF7hbqqfKYEGMHc984XnTUAPBAsjFoGYQ65JmhvFva
|
||||
aDMa8GeMzNMdYNTsJljhYbKlELGMhurJJ7ckkAg6UKQrpUQ7FwmBpU+zaDHKPQ6h
|
||||
8acak5aJfC/OtIpnPDYTBcC3zLNEOvs2QDtjKSVYK7/6AcD9tiYjo0Q95F1aex+M
|
||||
uqp0yoL83Oq/KxPnkGMo67ukON66Xt8hrSgVIVzL4PX5Xl1PtLSN4lleNN69S7ic
|
||||
-----END RSA PRIVATE KEY-----
|
||||
35
packages/engine.io/test/fixtures/client.crt
vendored
35
packages/engine.io/test/fixtures/client.crt
vendored
@@ -1,22 +1,17 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDtTCCAZ0CFCt+tjtA9647yZp8eNZurQtNp4x+MA0GCSqGSIb3DQEBDQUAMEUx
|
||||
CzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQK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u0WIChlPrV7ahlbFUde0sdqq1H0ZxBu4yABk
|
||||
tAYqgR6TRqbufvkXvxBmCFp3uq11kFLmeNu8VtaZDuaMwJ+9YT5SG8mbhFHwVz2S
|
||||
I3jNu1mm750TEWWMhPk=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
23
packages/engine.io/test/fixtures/client.csr
vendored
23
packages/engine.io/test/fixtures/client.csr
vendored
@@ -1,12 +1,15 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBrTCCARYCAQAwbTELMAkGA1UEBhMCRkkxEzARBgNVBAgTClNvbWUtU3RhdGUx
|
||||
ETAPBgNVBAcTCEhlbHNpbmtpMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0
|
||||
eSBMdGQxEzARBgNVBAMTCkZvbyBDbGllbnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
|
||||
MIGJAoGBAPrpGfw/w74wrXew/EggQwdcNFmF5EuoY2U2xfNoEtacpKVX5bGLU50K
|
||||
Ka0CHhkBVG3UmQr2ZAQAZ3ELxNHAMxLTb4RQrUfXO+HvsSThlwdbynkJUSbncVOY
|
||||
76OEv7sFBhdbXKL9dREG/bGbdD3kjvz3lqCmswUjweI678d2L+INAgMBAAGgADAN
|
||||
BgkqhkiG9w0BAQUFAAOBgQDKGUqjkUxGOisFN70X7ZOW7H99veR9QlixKl5e0W+7
|
||||
UtJ+GUtH2WQEb4F72+ruHrdDWQI1VaH9hPOvTRCjlgXiT0RHXpGPbJK/Nc+Eq5dm
|
||||
kuk/tQeXv6+S1fgYOm0w09rE7pBjQtuAybB55lGZ7k84UE2xTc97Ru14nYFCsZ4z
|
||||
RA==
|
||||
MIICVjCCAT4CAQAwETEPMA0GA1UEAwwGY2xpZW50MIIBIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAQ8AMIIBCgKCAQEAt6j+z+Gsbq6QNmrHk2xjRT2r9tQSQKjD2s0m5K6Vh7UQ
|
||||
5SnmOtlSdREepZNhcNbDEEZ8hEH01jVtsYvwbr/Z2yQii7qDw0CxaRypMAXP4LuD
|
||||
ejvM1HHYZggUMUW3DQfAcFiMy7zIISKpXfBmU9EolnX3fzj/ta2VQluVlqrVdUdT
|
||||
ttNiSh+shPwkULe9z93W37lwQw7OJI+QjNcTurBrHdhL/Yhz6yzX6/t5jmZxrHSM
|
||||
SdaDJGcEplQqnGCfGhqtoLWyuZmSXaoxxvSsneC073BCEuVhJlZBIPRm2ZK2MOVK
|
||||
XcgCEi9ipNF+o6WXLLAKApS53atSDsW/6WFJutN4yQIDAQABoAAwDQYJKoZIhvcN
|
||||
AQELBQADggEBAK/qIcDwg0kFcriPBU9+LGbpedbtw0naT3PVXfYYq3TzjBtPW+4c
|
||||
f5QmAhrIMkF0xQ1YdDsx9U/jQ93xL8OCo8+pbiQOYS0uVTqi/7UL9ggkD0aCGCZs
|
||||
j1FEWbumouW9ZuQg6gsZ9XoZmXPTKZivIpalOTV460vQvhM4Fspx0i7LowiS9ijH
|
||||
BGG8QEr1ZihhXQloJSnjwVMY8qqVwqvJDidkN7eSjZTL2yOBzgiigpk8IMe1bNrb
|
||||
dIoJVEjzFooRa08MPt+BZJ7xiuCyKZe6aVmV0XZOcnHChSc8jmSRXZdNpikGdQRX
|
||||
1BamYMxhR2x8QYX0DiJYZwpgUaG4EOHsqb8=
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
|
||||
43
packages/engine.io/test/fixtures/client.key
vendored
43
packages/engine.io/test/fixtures/client.key
vendored
@@ -1,15 +1,28 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQD66Rn8P8O+MK13sPxIIEMHXDRZheRLqGNlNsXzaBLWnKSlV+Wx
|
||||
i1OdCimtAh4ZAVRt1JkK9mQEAGdxC8TRwDMS02+EUK1H1zvh77Ek4ZcHW8p5CVEm
|
||||
53FTmO+jhL+7BQYXW1yi/XURBv2xm3Q95I7895agprMFI8HiOu/Hdi/iDQIDAQAB
|
||||
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Qparm2BWb/AIfBsaunYALuVvT4FwiAQhxoclJ8X4psaTF4BTBApdp
|
||||
SVEYOUdsXrnogybc2LiW93Y+2Z9oOjAZbH/qeRM+/RJSKXwrYo11KtXG3535H/x2
|
||||
1ZAahBUGDdrqNooD024Cxcu0jS7fKDPmSbozCf+tAoGAZ3NwWzj3LpArnfOrDr7Z
|
||||
rXiUvCmSjPUBF99vN080rU8fBILdQTdz5DdE3K0xWDEiwAk1NZbuwy4Fx02aHG9f
|
||||
5CkmGEHOsLGT6n6BHrjuSCtvbNOAGLhSBbBJJkFOf3ktJXU64P38M7OP0j11Tzkv
|
||||
VNurVfn19LNgoLisW5c9tEs=
|
||||
-----END PRIVATE KEY-----
|
||||
|
||||
18
packages/engine.io/test/fixtures/client.key.orig
vendored
18
packages/engine.io/test/fixtures/client.key.orig
vendored
@@ -1,18 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,081B123E7DBC9687
|
||||
|
||||
c8gE0LQMMtV7GhUcP7GHBotlNNAsbyG/gERB//BFlvRPjs43ALvm5xMGUkcsZkw9
|
||||
H6ljvvgyRkud06x1mGxqlZ4fLlty0/mdXf6791R9gA/9bKLakHGlwnoVUrEPIeh3
|
||||
Iu/3IF0Uz8o3uljSp9eehR8sW5V4o+Z1MszQ+GkcpCyYnDPykyN52QLTM3RcUJ0v
|
||||
2iJrgxYEAyMA14iIpYM8IsFDYIBvwVfQxyBZnQ+8dDQgVOokz56g+/9emgOsVjWj
|
||||
bdUKZ7+95RLxCq0hjJd8GnoDn7qtxIPOGVqYcdEwwNyzO43FnpjOFhNDWwsrNrgf
|
||||
vUHKhZRHB99CkuCvGg4fjVbFd/1/n3eE5VmiQuqoHzPnXH3RDIx2rZSjFo/NkzYx
|
||||
4XzZ4YOe6vOP7kR18CL+bl32WneMELoh+TPLmsSC3rIP48M8+oQINSZaBrl59Ocw
|
||||
NW36xgDNSQoia2splVNo51vtZomq1Hb3co6hD43D4xnrc6Aqucm3BsW6UCc/PVKv
|
||||
HAXLCb+3awIy5NJSYb0qRETE2rKB6LjmKfILtOrto6QYSlkJmQUxqoPXgRAWWNlw
|
||||
1Ngws84+6UjmGWDBlpZHn0hcO/B7KJAAS/xNSFYDoSu6dAbabxTI/dZCWhw1aN5c
|
||||
QeYPihCi66F6Vuq/QT89dHtZE4IMPH7R95Yp18tCcyVGxaEiphw3HJYepMxoJesQ
|
||||
YH8tWQwvD5LaADzNJIKBxMjCOK23GuXWQLJJRf4QWiXaQar69qXULxBT3iqBp/rQ
|
||||
VKsQByBwJlEo/YSEFjhhMgo0zSbqIRAY1XCDo+dgB2IB1KPAobhSCQ==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
BIN
packages/engine.io/test/fixtures/client.pfx
vendored
BIN
packages/engine.io/test/fixtures/client.pfx
vendored
Binary file not shown.
22
packages/engine.io/test/fixtures/generate_certs.sh
vendored
Executable file
22
packages/engine.io/test/fixtures/generate_certs.sh
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Generate CA private key and certificate
|
||||
openssl genrsa -out ca.key 2048
|
||||
openssl req -x509 -new -nodes -key ca.key -days 365 -out ca.crt -subj "/CN=Test CA"
|
||||
|
||||
# Generate server key and certificate request
|
||||
openssl genrsa -out server.key 2048
|
||||
openssl req -new -key server.key -out server.csr -subj "/CN=localhost"
|
||||
|
||||
# Generate client key and certificate request
|
||||
openssl genrsa -out client.key 2048
|
||||
openssl req -new -key client.key -out client.csr -subj "/CN=client"
|
||||
|
||||
# Sign server certificate with CA
|
||||
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 365
|
||||
|
||||
# Sign client certificate with CA
|
||||
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days 365
|
||||
|
||||
# Generate client PFX files
|
||||
openssl pkcs12 -export -passout pass: -out client.pfx -inkey client.key -in client.crt -certfile ca.crt
|
||||
35
packages/engine.io/test/fixtures/server.crt
vendored
35
packages/engine.io/test/fixtures/server.crt
vendored
@@ -1,22 +1,17 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDtDCCAZwCFCt+tjtA9647yZp8eNZurQtNp4x/MA0GCSqGSIb3DQEBDQUAMEUx
|
||||
CzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRl
|
||||
cm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMjIxMTE4MjEyNDExWhcNMzIxMTE1MjEy
|
||||
NDExWjBsMQswCQYDVQQGEwJGSTETMBEGA1UECBMKU29tZS1TdGF0ZTERMA8GA1UE
|
||||
BxMISGVsc2lua2kxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDES
|
||||
MBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDA
|
||||
QLNPDILqMIulvPga6ogci69xYaSp50U7Tv8Hww3m4D9w2ubyGqR7dDW20iGJI7tT
|
||||
Ncv/UtLqgknEiCBXkq/MDr5gdXNI0V/j+qAOqfJSVxvxxHxLrt7ivjpZHbO7B3K7
|
||||
bkWmCxAFzWAlE5U9FXX1b8VfetJv+cDEaXsYwuYfowIDAQABMA0GCSqGSIb3DQEB
|
||||
DQUAA4ICAQCDSuFPJ++HY5WBhpnumbZ7+T0ReWKaerdNnQ2Xgrna5mZfB2xeRkvY
|
||||
XeJ9VBCpGgEZKCKkhZCjomn/kLkYzRk4Sqr1ivN5NWl6G/9UTttHdRa3xiR1NhKI
|
||||
AMYghpel30w5e+cWtsdR06P2FvZMuiMFCyqsbPf1xcEIAXN7HJDswq6g0ppTVZ4L
|
||||
sXljG/J0vp+jAst4XKGLaGqnt8JaBnpNX9NO2Up3h5j7Pa4Nhm/LZ3Ku5ZVDmS1d
|
||||
B98Bsgr6tQSSyPNfZW0tGXELs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JKoZIhvcNAQELBQADggEB
|
||||
AJh7TfVR5lBVtWepx5ghWrWDrqEXw7nJp4ljaZ/tp+Ufb1LasMflbAnShvnhPAg4
|
||||
A5/7GkCUjZOMc5QV2MYQGIPtyRdM1rdPG6EuR8SUA/+GxIbaLo7iDpAKpcvCdFfS
|
||||
pd44wgDBbzbTtw3nRGy6RXm1vB2FyjvGWVXYL3XoE2r/xQPgaf93jeglbgo9C8Tj
|
||||
MQ2NdR4GPBtjqZNDmer6p2Jr31pkS4exT7oNysnZfoXll8F4PHos7Wc5VYo/2qQy
|
||||
uftfQqYIZLaZKzjR32Gsr6Z5yb8GlISWnRss5ebD6+wzh8sr4fat0SY/vy/3oq5V
|
||||
0lwYgNPo/OuwNMA7Eo/iNPY=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
22
packages/engine.io/test/fixtures/server.csr
vendored
22
packages/engine.io/test/fixtures/server.csr
vendored
@@ -1,11 +1,15 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBrDCCARUCAQAwbDELMAkGA1UEBhMCRkkxEzARBgNVBAgTClNvbWUtU3RhdGUx
|
||||
ETAPBgNVBAcTCEhlbHNpbmtpMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0
|
||||
eSBMdGQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
|
||||
gYkCgYEAwECzTwyC6jCLpbz4GuqIHIuvcWGkqedFO07/B8MN5uA/cNrm8hqke3Q1
|
||||
ttIhiSO7UzXL/1LS6oJJxIggV5KvzA6+YHVzSNFf4/qgDqnyUlcb8cR8S67e4r46
|
||||
WR2zuwdyu25FpgsQBc1gJROVPRV19W/FX3rSb/nAxGl7GMLmH6MCAwEAAaAAMA0G
|
||||
CSqGSIb3DQEBBQUAA4GBAClj/K2DAH5S64T6s7jervmk4N956Ho3aTLBgE+ReXLj
|
||||
btcTdk3vFbQApAlG6MrSKys4HjpKpP/RENx3Js0HHeb8ELmWtIQNxRhwIpl0K5AD
|
||||
xorKj+mwngLtVyARb/M7O3E8jYHzBPzpsolKWIY4AavYdmHu+Zhgm4hPKUcW+bAv
|
||||
MIICWTCCAUECAQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAQ8AMIIBCgKCAQEAycPe7U7Ek7WazlY3fPTSluePEsmgdeBobqqX3Nys
|
||||
RmuTjLml0FPWmJ56FAhFP2JUu+rfkoWbEAfV0eVBsu0+gAiaHZtrS7DJmjbdzl/C
|
||||
Wl1HiGPlAfaj6GhvHSwXpx2srPnbndjtkFBe0Ib0b1TvfDaxqVWmFaXrOZREIb8y
|
||||
o2oivjXOdYJ3UXWgJrwj1iDSAXoFMEW27AIDUGlvFBHcWFoVRfDA2v/yT0e605R0
|
||||
haujq/EiL0dQ/8QLbxF8gKj5ZHnSI4ejq9mAhCEdi8fvSstGLYub5odz6mRuoO5T
|
||||
AzoSIP35DtjX0/Rfs+qu0C+fsjh8yYAXqQu1eZ0EkDEK/QIDAQABoAAwDQYJKoZI
|
||||
hvcNAQELBQADggEBAI9mZrnDPk8PaljHRTLYlYNtL0+gVpav+deUnAzbjA5bxdaw
|
||||
t0xRptSDg3sFYFJWJ0HaqJltxSmdjj20MxmSCrexFOVXpISNsC/uZOs2CFWsDBdp
|
||||
kL6pIDHmxJF2q3dA7kZMeElSqUohYlA5t5rHp6w8/Vb0HnHAlke4kPd+bbo0MyFt
|
||||
mL2txXAz9AU8a5sG44x05VsSahtWSWeDNFbvaX27FhNDHxBMAFCj3niRQklMpCGG
|
||||
uX+OWr42iNJLhjyR7zsJ26tf1gP6+kFoAz2kRNC9qyQyTAzXNEydg6Yff1TuZv2h
|
||||
ktXz5unhsb91xO2iGT8PSWDHcVReSZRdyhwjYrI=
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
|
||||
43
packages/engine.io/test/fixtures/server.key
vendored
43
packages/engine.io/test/fixtures/server.key
vendored
@@ -1,15 +1,28 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXgIBAAKBgQDAQLNPDILqMIulvPga6ogci69xYaSp50U7Tv8Hww3m4D9w2uby
|
||||
GqR7dDW20iGJI7tTNcv/UtLqgknEiCBXkq/MDr5gdXNI0V/j+qAOqfJSVxvxxHxL
|
||||
rt7ivjpZHbO7B3K7bkWmCxAFzWAlE5U9FXX1b8VfetJv+cDEaXsYwuYfowIDAQAB
|
||||
AoGBAL7tQmXl2fmz/mu5kHhCpKwcuT6TpxEo4aN132aY+qxn1flBHAwiE2mbTmDi
|
||||
rHViq/2GNrK5UUed3p60RdJSlgwIkyqtcGxWhUJGYCR/hU60qeeLp3MhhOoOFbiV
|
||||
YTDsoC7V/SuWbX+1qG5FxnHSnTZhAIRkZXS4uTZ5WDcQm/7BAkEA+TlZ1IT9CeU/
|
||||
FpHpqc8RgR8377Ehjy8o4Z4EGFnxQlAUWASnhs6dw4isr3+c7hA1OEmqmcRClPVZ
|
||||
t1JbHAPC4QJBAMV60WSJzPUccCF47T9Ao2CeWFl/9dmgQQe9idpTNuKMXNtPJN44
|
||||
0MQvnb+xS828woJOoRI+/UTVLLBc4xwMtwMCQQDZTadExTw4v5l1nX5GoJUbp9PG
|
||||
/ARN64nSx0u8y9evwVErucs0oL0we+BOGZAEhz9QN/M3pceESDWUwYtNbv4hAkBB
|
||||
Ku2MqvjK7k6GjTxlgjQn/zkSl+qOnZa4MjEarhlPm5hM+wokl0U1aK07BAwK4b6i
|
||||
d8YpmkXEAEEWFiEQMZX3AkEA1SkdiFj1u7HnzO7onLJsnFzowX3pm1UFl0azOMlM
|
||||
2GkjYxWeJ/4VL7Y6QkhHE0Nj3my2+MJQI9xpYgMbw/l11w==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDJw97tTsSTtZrO
|
||||
Vjd89NKW548S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HUwNalciAOgrhuGNDViazH9JpkK
|
||||
pFaX7lhaIQKBgQCQKUyyPaDcC0BCIjtsDlSWIwNjellu/ACyo8sa0unnPlHJTXRV
|
||||
SN5wi0oA/tkmNrRJ4ZenmZQkO3ACIPHEApIkefTPiOV/kG7JDsW6dPB08XdzL1s8
|
||||
AZp4RnhoPHefR7tf/C3WcyzOqPi4yNWA/t8jY53y7faVoJXuOAA0k9eWXQKBgEvk
|
||||
GI/igz/mktcGCS5IL/i0xWIGQePVGZlAsdn1pVwOeE/w6sD7YHoFzg0ng4aizmku
|
||||
0KNy7r6Gc5qdlBtVJqYuzzJB2q+zUBEJpgvin6XTSDAPmJIb/Z96tznF/b4ZhaO2
|
||||
P9hrIbzqEYLXBCeDEELrwLzIzfeI/RbndUAS7XeBAoGAa8WGdE7ndAtjCK4jCFiB
|
||||
vIt4M6EZyZdmfTJ91SSEA303mp10cV6YGLOErROnBvnUlFSbRN8VNVA/LYq3M4Vm
|
||||
da5jaFCjJhvH6qFhwsAkuGKsE1OPTs56iqZlSw9/8IJ6NW7/Igy6xR/Z5xRajAzl
|
||||
FsyRRSHduI5HNgDo7riv46M=
|
||||
-----END PRIVATE KEY-----
|
||||
|
||||
18
packages/engine.io/test/fixtures/server.key.orig
vendored
18
packages/engine.io/test/fixtures/server.key.orig
vendored
@@ -1,18 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,8A14F3F31BF3CDF7
|
||||
|
||||
84UpLjX5GbfCoP/+ZRLwHZHqmgKyc2cjQOQKhp2YTk+4E0JSO7KsKwJax55r5VqE
|
||||
ECGvbd8yvVZ3GRpU6bDCLelDN+Ob5ZSGhynI0f9is6Qle1/SbvaK+qL6MLf4H38l
|
||||
Y91eZxjE8hLvOMHBlbobLmy9UUzl2osBDAM1nm5d1X7pF7mN4xgY8s2G7UPq3ZZS
|
||||
NWwMsnwtb/9Ahm7WXfsJbebyKspkTSHYp/ozaOGW58fuKxkwRFd1UlyblZWU3ezP
|
||||
JCpvJQ7HS6Dfy6+GUaxcC6pyxqnoJHYccB5usJ2h4QD4Es3sT7Vw7M80JKw3vAWm
|
||||
TH7VkFX3yGfJ1p1jNzifN5687QqrjeI3/ecTs1rFhIC4TUPN9EDvw86Y6l6Mvo04
|
||||
Hl2cVzCnCrZYq0ICD0op3+7f9kuKl7bz54S/iRG2qQdICohPs7ra2yaUy+NFVDs1
|
||||
XdXyF5/xew+Rr2z7ygEd+OrvXxPV0zTFbicg9GXGeB/pIYAclmoSNXD5T3voN7y9
|
||||
5MjSGL375N3z+kqPzMNawYCnZLwQ5jYTDUkDTATYpjcIDVDQkzbl8mFp4i+Z9GhL
|
||||
H8FRAgmBbkgy3dxhFjxr/WzuaTkUCAbGhrtPd8WCPhBXJBzWdrBVR9SE8zT9n8lq
|
||||
ZwaPwkPLBrLe/XZFEQJ5cdvMVNy4QQwsyxHnCgO3VUc68UYXb39MvyM6t8+S1rSm
|
||||
SyvVAT+jB8T4VlE7tedQGuvyKMmeNIJe9znd3u4S+Aq2+vw6bOKeNYBMaupR5Gyl
|
||||
bJrscuTG1aLUe+XH9BuFBUoIwdXuBv4Ko/pDL0MYPghDAEGkp4Acmg==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -99,6 +99,26 @@ function setup(opts, cb) {
|
||||
});
|
||||
}
|
||||
|
||||
function createHttpServer(port) {
|
||||
const httpServer = createServer();
|
||||
|
||||
let retryCount = 0;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
httpServer.listen(port, () => resolve(httpServer));
|
||||
|
||||
httpServer.on("error", (e) => {
|
||||
if (e.code === "EADDRINUSE" && ++retryCount <= 3) {
|
||||
console.warn("port already in use, retrying...");
|
||||
setTimeout(() => {
|
||||
httpServer.listen(port, () => resolve(httpServer));
|
||||
}, 100);
|
||||
}
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
describe("WebTransport", () => {
|
||||
it("should allow to connect with WebTransport directly", (done) => {
|
||||
setupServer({}, async ({ engine, h3Server, certificate }) => {
|
||||
@@ -154,9 +174,8 @@ describe("WebTransport", () => {
|
||||
transports: ["polling", "websocket", "webtransport"],
|
||||
},
|
||||
async ({ engine, h3Server, certificate }) => {
|
||||
const httpServer = createServer();
|
||||
const httpServer = await createHttpServer(h3Server.port);
|
||||
engine.attach(httpServer);
|
||||
httpServer.listen(h3Server.port);
|
||||
|
||||
const partialDone = createPartialDone(() => {
|
||||
httpServer.close();
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
# History
|
||||
# Changelog
|
||||
|
||||
- [2.5.5](#255-2024-06-18) (Jun 2024)
|
||||
- [2.5.4](#254-2024-02-22) (Feb 2024)
|
||||
- [2.5.3](#253-2024-02-21) (Feb 2024)
|
||||
- [2.5.2](#252-2023-01-12) (Jan 2023)
|
||||
- [2.5.1](#251-2023-01-06) (Jan 2023)
|
||||
- [2.5.0](#250-2023-01-06) (Jan 2023)
|
||||
- [2.4.0](#240-2022-03-30) (Mar 2022)
|
||||
- [2.3.3](#233-2021-11-16) (Nov 2021)
|
||||
- [2.3.2](#232-2021-08-28) (Aug 2021)
|
||||
- [2.3.1](#231-2021-05-19) (May 2021)
|
||||
- [2.3.0](#230-2021-05-10) (May 2021)
|
||||
- [2.2.0](#220-2021-02-27) (Feb 2021)
|
||||
- [2.1.0](#210-2021-01-15) (Jan 2021)
|
||||
- [2.0.3](#203-2020-11-05) (Nov 2020)
|
||||
- [2.0.2](#202-2020-09-28) (Sep 2020)
|
||||
- [2.0.1](#201-2020-09-28) (Sep 2020)
|
||||
- [**2.0.0**](#200-2020-09-25) (Sep 2020)
|
||||
| Version | Release date |
|
||||
|------------------------------|----------------|
|
||||
| [2.5.6](#256-2025-12-23) | December 2025 |
|
||||
| [2.5.5](#255-2024-06-18) | June 2024 |
|
||||
| [2.5.4](#254-2024-02-22) | February 2024 |
|
||||
| [2.5.3](#253-2024-02-21) | February 2024 |
|
||||
| [2.5.2](#252-2023-01-12) | January 2023 |
|
||||
| [2.5.1](#251-2023-01-06) | January 2023 |
|
||||
| [2.5.0](#250-2023-01-06) | January 2023 |
|
||||
| [2.4.0](#240-2022-03-30) | March 2022 |
|
||||
| [2.3.3](#233-2021-11-16) | November 2021 |
|
||||
| [2.3.2](#232-2021-08-28) | August 2021 |
|
||||
| [2.3.1](#231-2021-05-19) | May 2021 |
|
||||
| [2.3.0](#230-2021-05-10) | May 2021 |
|
||||
| [2.2.0](#220-2021-02-27) | February 2021 |
|
||||
| [2.1.0](#210-2021-01-15) | January 2021 |
|
||||
| [2.0.3](#203-2020-11-05) | November 2020 |
|
||||
| [2.0.2](#202-2020-09-28) | September 2020 |
|
||||
| [2.0.1](#201-2020-09-28) | September 2020 |
|
||||
| [**2.0.0**](#200-2020-09-25) | September 2020 |
|
||||
|
||||
|
||||
## [2.5.6](https://github.com/socketio/socket.io/compare/socket.io-adapter@2.5.5...socket.io-adapter@2.5.6) (2025-12-23)
|
||||
|
||||
This release contains a bump of:
|
||||
|
||||
- `ws` from `~8.17.1` to `~8.18.3`
|
||||
- `debug` from `~4.3.1` to `~4.4.1`
|
||||
|
||||
|
||||
# Release notes
|
||||
|
||||
## [2.5.5](https://github.com/socketio/socket.io-adapter/compare/2.5.4...2.5.5) (2024-06-18)
|
||||
|
||||
|
||||
@@ -199,6 +199,14 @@ export abstract class ClusterAdapter extends Adapter {
|
||||
return debug("[%s] ignore message from self", this.uid);
|
||||
}
|
||||
|
||||
if (message.nsp !== this.nsp.name) {
|
||||
return debug(
|
||||
"[%s] ignore message from another namespace (%s)",
|
||||
this.uid,
|
||||
message.nsp,
|
||||
);
|
||||
}
|
||||
|
||||
debug(
|
||||
"[%s] new event of type %d from %s",
|
||||
this.uid,
|
||||
@@ -671,6 +679,8 @@ export abstract class ClusterAdapter extends Adapter {
|
||||
protected publish(
|
||||
message: DistributiveOmit<ClusterMessage, "nsp" | "uid">,
|
||||
): void {
|
||||
debug("[%s] sending message %s", this.uid, message.type);
|
||||
|
||||
this.publishAndReturnOffset(message).catch((err) => {
|
||||
debug("[%s] error while publishing message: %s", this.uid, err);
|
||||
});
|
||||
@@ -699,6 +709,14 @@ export abstract class ClusterAdapter extends Adapter {
|
||||
) {
|
||||
(response as ClusterResponse).uid = this.uid;
|
||||
(response as ClusterResponse).nsp = this.nsp.name;
|
||||
|
||||
debug(
|
||||
"[%s] sending response %s to %s",
|
||||
this.uid,
|
||||
response.type,
|
||||
requesterUid,
|
||||
);
|
||||
|
||||
this.doPublishResponse(requesterUid, response as ClusterResponse).catch(
|
||||
(err) => {
|
||||
debug("[%s] error while publishing response: %s", this.uid, err);
|
||||
@@ -790,17 +808,10 @@ export abstract class ClusterAdapterWithHeartbeat extends ClusterAdapter {
|
||||
}
|
||||
|
||||
if (message.uid && message.uid !== EMITTER_UID) {
|
||||
// we track the UID of each sender, in order to know how many servers there are in the cluster
|
||||
// we track the UID of each sender to know how many servers there are in the cluster
|
||||
this.nodesMap.set(message.uid, Date.now());
|
||||
}
|
||||
|
||||
debug(
|
||||
"[%s] new event of type %d from %s",
|
||||
this.uid,
|
||||
message.type,
|
||||
message.uid,
|
||||
);
|
||||
|
||||
switch (message.type) {
|
||||
case MessageType.INITIAL_HEARTBEAT:
|
||||
this.publish({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "socket.io-adapter",
|
||||
"version": "2.5.5",
|
||||
"version": "2.5.6",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/socketio/socket.io/tree/main/packages/socket.io-adapter#readme",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "rimraf ./dist && tsc",
|
||||
"test": "npm run format:check && npm run compile && nyc mocha --require ts-node/register test/*.ts",
|
||||
"test": "npm run format:check && npm run compile && nyc mocha --import=tsx test/*.ts",
|
||||
"format:check": "prettier --parser typescript --check 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
"format:fix": "prettier --parser typescript --write 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
"prepack": "npm run compile"
|
||||
|
||||
@@ -67,11 +67,6 @@ describe("cluster adapter", () => {
|
||||
serverSockets.push(socket);
|
||||
servers.push(io);
|
||||
if (servers.length === NODES_COUNT) {
|
||||
// ensure all nodes know each other
|
||||
servers[0].emit("ping");
|
||||
servers[1].emit("ping");
|
||||
servers[2].emit("ping");
|
||||
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# History
|
||||
# Changelog
|
||||
|
||||
| Version | Release date | Bundle size (UMD min+gzip) |
|
||||
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
|
||||
| [4.8.2](#482-2025-12-22) | December 2024 | `14.4 KB` |
|
||||
| [4.8.1](#481-2024-10-25) | October 2024 | `14.4 KB` |
|
||||
| [4.8.0](#480-2024-09-21) | September 2024 | `14.4 KB` |
|
||||
| [4.7.5](#475-2024-03-14) | March 2024 | `14.6 KB` |
|
||||
@@ -50,7 +51,21 @@
|
||||
| [2.1.0](#210-2018-03-29) | March 2018 | `18.7 KB` |
|
||||
|
||||
|
||||
# Release notes
|
||||
## [4.8.2](https://github.com/socketio/socket.io/compare/socket.io-client@4.8.1...socket.io-client@4.8.2) (2025-12-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bundle** do not mangle the "_placeholder" attribute (bis) ([cdae019](https://github.com/socketio/socket.io/commit/cdae01983a8ae840fc9812875a8b88166b377c11))
|
||||
* drain queue before emitting "connect" ([#5259](https://github.com/socketio/socket.io/issues/5259)) ([d19928e](https://github.com/socketio/socket.io/commit/d19928e8d8b325310274031ed7de2ddc93ebb589)
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
- [`engine.io-client@~6.6.1`](https://github.com/socketio/engine.io-client/releases/tag/6.5.2) (no change)
|
||||
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) (no change)
|
||||
|
||||
|
||||
|
||||
## [4.8.1](https://github.com/socketio/socket.io/compare/socket.io-client@4.8.0...socket.io-client@4.8.1) (2024-10-25)
|
||||
|
||||
|
||||
11
packages/socket.io-client/RELEASING.md
Normal file
11
packages/socket.io-client/RELEASING.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Releasing
|
||||
|
||||
1. Update the version in `package.json`
|
||||
2. Update the version in `support/package.esm.json`
|
||||
3. Update the changelog `CHANGELOG.md` with `conventional-changelog -p angular`
|
||||
4. Compile the TypeScript sources with `npm run compile`
|
||||
5. Generate the bundles with `npm run build`
|
||||
6. Commit the changes in `package.json`, `support/package.esm.json`, `CHANGELOG.md` and `dist/`
|
||||
7. Create the tag `socket.io-client@x.y.z` and push it to the GitHub repository. The workflow `.github/workflows/publish.yml` will safely publish the package to npm using trusted publishing.
|
||||
8. Create a new release at https://github.com/socketio/socket.io/releases
|
||||
9. Copy the bundles to the repository https://github.com/socketio/socket.io-cdn so that they are available at https://cdn.socket.io/
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
131
packages/socket.io-client/dist/socket.io.js
vendored
131
packages/socket.io-client/dist/socket.io.js
vendored
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Socket.IO v4.8.1
|
||||
* (c) 2014-2024 Guillermo Rauch
|
||||
* Socket.IO v4.8.2
|
||||
* (c) 2014-2025 Guillermo Rauch
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
(function (global, factory) {
|
||||
@@ -899,7 +899,7 @@
|
||||
return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
|
||||
};
|
||||
_proto._port = function _port() {
|
||||
if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {
|
||||
if (this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80)) {
|
||||
return ":" + this.opts.port;
|
||||
} else {
|
||||
return "";
|
||||
@@ -2669,21 +2669,65 @@
|
||||
createDebug.namespaces = namespaces;
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
var i;
|
||||
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
||||
var len = split.length;
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!split[i]) {
|
||||
// ignore empty strings
|
||||
continue;
|
||||
var split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(/\s+/g, ',').split(',').filter(Boolean);
|
||||
var _iterator = _createForOfIteratorHelper(split),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var ns = _step.value;
|
||||
if (ns[0] === '-') {
|
||||
createDebug.skips.push(ns.slice(1));
|
||||
} else {
|
||||
createDebug.names.push(ns);
|
||||
}
|
||||
}
|
||||
namespaces = split[i].replace(/\*/g, '.*?');
|
||||
if (namespaces[0] === '-') {
|
||||
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given string matches a namespace template, honoring
|
||||
* asterisks as wildcards.
|
||||
*
|
||||
* @param {String} search
|
||||
* @param {String} template
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function matchesTemplate(search, template) {
|
||||
var searchIndex = 0;
|
||||
var templateIndex = 0;
|
||||
var starIndex = -1;
|
||||
var matchIndex = 0;
|
||||
while (searchIndex < search.length) {
|
||||
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
||||
// Match character or proceed with wildcard
|
||||
if (template[templateIndex] === '*') {
|
||||
starIndex = templateIndex;
|
||||
matchIndex = searchIndex;
|
||||
templateIndex++; // Skip the '*'
|
||||
} else {
|
||||
searchIndex++;
|
||||
templateIndex++;
|
||||
}
|
||||
} else if (starIndex !== -1) {
|
||||
// eslint-disable-line no-negated-condition
|
||||
// Backtrack to the last '*' and try to match more characters
|
||||
templateIndex = starIndex + 1;
|
||||
matchIndex++;
|
||||
searchIndex = matchIndex;
|
||||
} else {
|
||||
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
||||
return false; // No match
|
||||
}
|
||||
}
|
||||
|
||||
// Handle trailing '*' in template
|
||||
while (templateIndex < template.length && template[templateIndex] === '*') {
|
||||
templateIndex++;
|
||||
}
|
||||
return templateIndex === template.length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2693,7 +2737,7 @@
|
||||
* @api public
|
||||
*/
|
||||
function disable() {
|
||||
var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
|
||||
var namespaces = [].concat(_toConsumableArray(createDebug.names), _toConsumableArray(createDebug.skips.map(function (namespace) {
|
||||
return '-' + namespace;
|
||||
}))).join(',');
|
||||
createDebug.enable('');
|
||||
@@ -2708,35 +2752,37 @@
|
||||
* @api public
|
||||
*/
|
||||
function enabled(name) {
|
||||
if (name[name.length - 1] === '*') {
|
||||
return true;
|
||||
}
|
||||
var i;
|
||||
var len;
|
||||
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
||||
if (createDebug.skips[i].test(name)) {
|
||||
return false;
|
||||
var _iterator2 = _createForOfIteratorHelper(createDebug.skips),
|
||||
_step2;
|
||||
try {
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
var skip = _step2.value;
|
||||
if (matchesTemplate(name, skip)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
||||
if (createDebug.names[i].test(name)) {
|
||||
return true;
|
||||
var _iterator3 = _createForOfIteratorHelper(createDebug.names),
|
||||
_step3;
|
||||
try {
|
||||
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
||||
var ns = _step3.value;
|
||||
if (matchesTemplate(name, ns)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator3.e(err);
|
||||
} finally {
|
||||
_iterator3.f();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert regexp to namespace
|
||||
*
|
||||
* @param {RegExp} regxep
|
||||
* @return {String} namespace
|
||||
* @api private
|
||||
*/
|
||||
function toNamespace(regexp) {
|
||||
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce `val`.
|
||||
*
|
||||
@@ -2812,15 +2858,17 @@
|
||||
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
||||
return false;
|
||||
}
|
||||
var m;
|
||||
|
||||
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||
// eslint-disable-next-line no-return-assign
|
||||
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
||||
// Is firebug? http://stackoverflow.com/a/398120/376773
|
||||
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
||||
// Is firefox >= v31?
|
||||
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 ||
|
||||
// Double check webkit in userAgent just in case we are in a worker
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
||||
}
|
||||
@@ -2896,7 +2944,7 @@
|
||||
function load() {
|
||||
var r;
|
||||
try {
|
||||
r = exports.storage.getItem('debug');
|
||||
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG');
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
@@ -3828,8 +3876,7 @@
|
||||
};
|
||||
args.push(function (err) {
|
||||
if (packet !== _this4._queue[0]) {
|
||||
// the packet has already been acknowledged
|
||||
return;
|
||||
return debug$2("packet [%d] already acknowledged", packet.id);
|
||||
}
|
||||
var hasError = err !== null;
|
||||
if (hasError) {
|
||||
@@ -4100,8 +4147,8 @@
|
||||
this._pid = pid; // defined only if connection state recovery is enabled
|
||||
this.connected = true;
|
||||
this.emitBuffered();
|
||||
this.emitReserved("connect");
|
||||
this._drainQueue(true);
|
||||
this.emitReserved("connect");
|
||||
}
|
||||
/**
|
||||
* Emit buffered events (received and emitted).
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
import { url } from "./url.js";
|
||||
import { Manager, ManagerOptions } from "./manager.js";
|
||||
import { Socket, SocketOptions } from "./socket.js";
|
||||
import { DisconnectDescription, Socket, SocketOptions } from "./socket.js";
|
||||
import debugModule from "debug"; // debug()
|
||||
|
||||
const debug = debugModule("socket.io-client"); // debug()
|
||||
@@ -91,6 +91,7 @@ export { protocol } from "socket.io-parser";
|
||||
*/
|
||||
|
||||
export {
|
||||
DisconnectDescription,
|
||||
Manager,
|
||||
ManagerOptions,
|
||||
Socket,
|
||||
|
||||
@@ -542,8 +542,7 @@ export class Socket<
|
||||
|
||||
args.push((err, ...responseArgs) => {
|
||||
if (packet !== this._queue[0]) {
|
||||
// the packet has already been acknowledged
|
||||
return;
|
||||
return debug("packet [%d] already acknowledged", packet.id);
|
||||
}
|
||||
const hasError = err !== null;
|
||||
if (hasError) {
|
||||
@@ -834,8 +833,8 @@ export class Socket<
|
||||
this._pid = pid; // defined only if connection state recovery is enabled
|
||||
this.connected = true;
|
||||
this.emitBuffered();
|
||||
this.emitReserved("connect");
|
||||
this._drainQueue(true);
|
||||
this.emitReserved("connect");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "socket.io-client",
|
||||
"version": "4.8.1",
|
||||
"version": "4.8.2",
|
||||
"description": "Realtime application framework client",
|
||||
"keywords": [
|
||||
"realtime",
|
||||
@@ -53,7 +53,7 @@
|
||||
"scripts": {
|
||||
"compile": "rimraf ./build && tsc && tsc -p tsconfig.esm.json && ./postcompile.sh",
|
||||
"test": "npm run format:check && npm run compile && if test \"$BROWSERS\" = \"1\" ; then npm run test:browser; else npm run test:node; fi",
|
||||
"test:node": "mocha --require ts-node/register --require test/support/hooks.ts --exit test/index.ts",
|
||||
"test:node": "mocha --import=tsx --require test/support/hooks.ts --exit test/index.ts",
|
||||
"test:browser": "ts-node test/browser-runner.ts",
|
||||
"test:types": "tsd",
|
||||
"build": "rollup -c support/rollup.config.umd.js && rollup -c support/rollup.config.esm.js && rollup -c support/rollup.config.umd.msgpack.js",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "socket.io-client",
|
||||
"version": "4.7.5",
|
||||
"version": "4.8.2",
|
||||
"type": "module"
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ module.exports = {
|
||||
mangle: {
|
||||
properties: {
|
||||
regex: /^_/,
|
||||
reserved: ["_placeholder"],
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -110,4 +110,40 @@ describe("retry", () => {
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
|
||||
it("should not emit a packet twice in the 'connect' handler", () => {
|
||||
return wrap((done) => {
|
||||
const socket = io(BASE_URL, {
|
||||
forceNew: true,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const received: string[] = [];
|
||||
const sent: string[] = [];
|
||||
|
||||
socket.io.engine.on("packetCreate", ({ data }) => {
|
||||
sent.push(data);
|
||||
});
|
||||
|
||||
socket.io.engine.on("packet", ({ data }) => {
|
||||
received.push(data);
|
||||
});
|
||||
|
||||
socket.on("connect", () => {
|
||||
socket.emit("echo", null);
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
expect(sent).to.eql(["0", '20["echo",null]']);
|
||||
|
||||
expect(received.length).to.eql(3);
|
||||
// 1: engine.io OPEN packet
|
||||
// 2: socket.io CONNECT packet
|
||||
// 3: ack packet
|
||||
expect(received[2]).to.eql("30[null]");
|
||||
|
||||
success(done, socket);
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"scripts": {
|
||||
"compile": "rimraf ./dist && tsc",
|
||||
"test": "npm run format:check && npm run compile && nyc mocha --import=tsx test/index.ts",
|
||||
"format:check": "prettier --check \"lib/**/*.ts' \"test/**/*.ts\"",
|
||||
"format:check": "prettier --check \"lib/**/*.ts\" \"test/**/*.ts\"",
|
||||
"format:fix": "prettier --write \"lib/**/*.ts\" \"test/**/*.ts\"",
|
||||
"prepack": "npm run compile"
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"scripts": {
|
||||
"compile": "rimraf ./dist && tsc",
|
||||
"test": "npm run format:check && npm run compile && npm run test:unit",
|
||||
"test:unit": "mocha --require ts-node/register test/*.ts",
|
||||
"test:unit": "mocha --import=tsx test/*.ts",
|
||||
"format:check": "prettier --check \"lib/**/*.ts\" \"test/**/*.ts\"",
|
||||
"format:fix": "prettier --write \"lib/**/*.ts\" \"test/**/*.ts\"",
|
||||
"prepack": "npm run compile"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# History
|
||||
# Changelog
|
||||
|
||||
| Version | Release date |
|
||||
|-------------------------------------------------------------------------------------------------------------|----------------|
|
||||
| [4.2.5](#425-2025-12-23) | December 2025 |
|
||||
| [3.3.4](#334-2024-07-22) (from the [3.3.x](https://github.com/socketio/socket.io-parser/tree/3.3.x) branch) | July 2024 |
|
||||
| [4.2.4](#424-2023-05-31) | May 2023 |
|
||||
| [3.4.3](#343-2023-05-22) (from the [3.4.x](https://github.com/socketio/socket.io-parser/tree/3.4.x) branch) | May 2023 |
|
||||
@@ -33,7 +34,11 @@
|
||||
| [3.3.0](#330-2018-11-07) | November 2018 |
|
||||
|
||||
|
||||
# Release notes
|
||||
## [4.2.5](https://github.com/socketio/socket.io/compare/socket.io-parser@4.2.4...socket.io-parser@4.2.5) (2025-12-23)
|
||||
|
||||
This release contains a bump of `debug` from `~4.3.1` to `~4.4.1`.
|
||||
|
||||
|
||||
|
||||
## [3.3.4](https://github.com/Automattic/socket.io-parser/compare/3.3.3...3.3.4) (2024-07-22)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "socket.io-parser",
|
||||
"version": "4.2.4",
|
||||
"version": "4.2.5",
|
||||
"description": "socket.io protocol parser",
|
||||
"homepage": "https://github.com/socketio/socket.io/tree/main/packages/socket.io-client#readme",
|
||||
"repository": {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"compile": "rimraf ./dist && tsc",
|
||||
"test": "npm run format:check && npm run compile && nyc mocha --require ts-node/register --timeout 5000 test/index.ts",
|
||||
"test": "npm run format:check && npm run compile && nyc mocha --import=tsx --timeout 5000 test/index.ts",
|
||||
"format:check": "prettier --parser typescript --check 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
"format:fix": "prettier --parser typescript --write 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
"prepack": "npm run compile"
|
||||
|
||||
19
packages/socket.io-redis-streams-emitter/CHANGELOG.md
Normal file
19
packages/socket.io-redis-streams-emitter/CHANGELOG.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
| Version | Release date |
|
||||
|--------------------------|---------------|
|
||||
| [0.1.1](#011-2025-11-07) | November 2025 |
|
||||
| [0.1.0](#010-2025-11-06) | November 2025 |
|
||||
|
||||
|
||||
## [0.1.1](https://github.com/socketio/socket.io/compare/@socket.io/redis-streams-emitter@0.1.0...@socket.io/redis-streams-emitter@0.1.1) (2025-11-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove dependency on socket.io-adapter ([7617707](https://github.com/socketio/socket.io/commit/7617707ed8f0defd0e19cb7c6963504ce7b87f6b))
|
||||
|
||||
|
||||
## 0.1.0 (2025-11-06)
|
||||
|
||||
Initial release!
|
||||
7
packages/socket.io-redis-streams-emitter/LICENSE
Normal file
7
packages/socket.io-redis-streams-emitter/LICENSE
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2025-present Guillermo Rauch and Socket.IO contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
220
packages/socket.io-redis-streams-emitter/README.md
Normal file
220
packages/socket.io-redis-streams-emitter/README.md
Normal file
@@ -0,0 +1,220 @@
|
||||
# Socket.IO Redis Streams emitter
|
||||
|
||||
The `@socket.io/redis-streams-emitter` package allows you to easily communicate with a group of Socket.IO servers from another Node.js process (server-side).
|
||||
|
||||
It must be used in conjunction with [`@socket.io/redis-streams-adapter`](https://github.com/socketio/socket.io-redis-streams-adapter).
|
||||
|
||||
**Table of contents**
|
||||
|
||||
<!-- TOC -->
|
||||
* [Installation](#installation)
|
||||
* [Usage](#usage)
|
||||
* [With the `redis` package](#with-the-redis-package)
|
||||
* [With the `redis` package and a Redis cluster](#with-the-redis-package-and-a-redis-cluster)
|
||||
* [With the `ioredis` package](#with-the-ioredis-package)
|
||||
* [With the `ioredis` package and a Redis cluster](#with-the-ioredis-package-and-a-redis-cluster)
|
||||
* [Options](#options)
|
||||
* [API](#api)
|
||||
* [`Emitter(redisClient[, nsp][, opts])`](#emitterredisclient-nsp-opts)
|
||||
* [`Emitter#to(room:string):BroadcastOperator`](#emittertoroomstringbroadcastoperator)
|
||||
* [`Emitter#in(room:string):BroadcastOperator`](#emitterinroomstringbroadcastoperator)
|
||||
* [`Emitter#except(room:string):BroadcastOperator`](#emitterexceptroomstringbroadcastoperator)
|
||||
* [`Emitter#of(namespace:string):Emitter`](#emitterofnamespacestringemitter)
|
||||
* [`Emitter#socketsJoin(rooms:string|string[])`](#emittersocketsjoinroomsstringstring)
|
||||
* [`Emitter#socketsLeave(rooms:string|string[])`](#emittersocketsleaveroomsstringstring)
|
||||
* [`Emitter#disconnectSockets(close:boolean)`](#emitterdisconnectsocketscloseboolean)
|
||||
* [`Emitter#serverSideEmit(ev:string[,...args:any[]])`](#emitterserversideemitevstringargsany)
|
||||
* [License](#license)
|
||||
<!-- TOC -->
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install @socket.io/redis-streams-emitter redis
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### With the `redis` package
|
||||
|
||||
```js
|
||||
import { createClient } from "redis";
|
||||
import { Emitter } from "@socket.io/redis-streams-emitter";
|
||||
|
||||
const redisClient = createClient({
|
||||
url: "redis://localhost:6379"
|
||||
});
|
||||
|
||||
await redisClient.connect();
|
||||
|
||||
const io = new Emitter(redisClient);
|
||||
|
||||
setInterval(() => {
|
||||
io.emit("ping", new Date());
|
||||
}, 1000);
|
||||
```
|
||||
|
||||
### With the `redis` package and a Redis cluster
|
||||
|
||||
```js
|
||||
import { createCluster } from "redis";
|
||||
import { Emitter } from "@socket.io/redis-streams-emitter";
|
||||
|
||||
const redisClient = createCluster({
|
||||
rootNodes: [
|
||||
{
|
||||
url: "redis://localhost:7000",
|
||||
},
|
||||
{
|
||||
url: "redis://localhost:7001",
|
||||
},
|
||||
{
|
||||
url: "redis://localhost:7002",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
await redisClient.connect();
|
||||
|
||||
const io = new Emitter(redisClient);
|
||||
|
||||
setInterval(() => {
|
||||
io.emit("ping", new Date());
|
||||
}, 1000);
|
||||
```
|
||||
|
||||
### With the `ioredis` package
|
||||
|
||||
```js
|
||||
import { Redis } from "ioredis";
|
||||
import { Emitter } from "@socket.io/redis-streams-emitter";
|
||||
|
||||
const redisClient = new Redis();
|
||||
|
||||
const io = new Emitter(redisClient);
|
||||
|
||||
setInterval(() => {
|
||||
io.emit("ping", new Date());
|
||||
}, 1000);
|
||||
```
|
||||
|
||||
### With the `ioredis` package and a Redis cluster
|
||||
|
||||
```js
|
||||
import { Cluster } from "ioredis";
|
||||
import { Emitter } from "@socket.io/redis-streams-emitter";
|
||||
|
||||
const redisClient = new Cluster([
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7000,
|
||||
},
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7001,
|
||||
},
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7002,
|
||||
},
|
||||
]);
|
||||
|
||||
const io = new Emitter(redisClient);
|
||||
|
||||
setInterval(() => {
|
||||
io.emit("ping", new Date());
|
||||
}, 1000);
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
| Name | Description | Default value |
|
||||
|--------------|--------------------------------------------------------------------|---------------|
|
||||
| `streamName` | The name of the Redis stream. | `socket.io` |
|
||||
| `maxLen` | The maximum size of the stream. Almost exact trimming (~) is used. | `10_000` |
|
||||
|
||||
## API
|
||||
|
||||
### `Emitter(redisClient[, nsp][, opts])`
|
||||
|
||||
```js
|
||||
const io = new Emitter(redisClient);
|
||||
```
|
||||
|
||||
### `Emitter#to(room:string):BroadcastOperator`
|
||||
### `Emitter#in(room:string):BroadcastOperator`
|
||||
|
||||
Specifies a specific `room` that you want to emit to.
|
||||
|
||||
```js
|
||||
io.to("room1").emit("hello");
|
||||
```
|
||||
|
||||
### `Emitter#except(room:string):BroadcastOperator`
|
||||
|
||||
Specifies a specific `room` that you want to exclude from broadcasting.
|
||||
|
||||
```js
|
||||
io.except("room2").emit("hello");
|
||||
```
|
||||
|
||||
### `Emitter#of(namespace:string):Emitter`
|
||||
|
||||
Specifies a specific namespace that you want to emit to.
|
||||
|
||||
```js
|
||||
const customNamespace = io.of("/custom");
|
||||
|
||||
customNamespace.emit("hello");
|
||||
```
|
||||
|
||||
### `Emitter#socketsJoin(rooms:string|string[])`
|
||||
|
||||
Makes the matching socket instances join the specified rooms:
|
||||
|
||||
```js
|
||||
// make all Socket instances join the "room1" room
|
||||
io.socketsJoin("room1");
|
||||
|
||||
// make all Socket instances of the "admin" namespace in the "room1" room join the "room2" room
|
||||
io.of("/admin").in("room1").socketsJoin("room2");
|
||||
```
|
||||
|
||||
### `Emitter#socketsLeave(rooms:string|string[])`
|
||||
|
||||
Makes the matching socket instances leave the specified rooms:
|
||||
|
||||
```js
|
||||
// make all Socket instances leave the "room1" room
|
||||
io.socketsLeave("room1");
|
||||
|
||||
// make all Socket instances of the "admin" namespace in the "room1" room leave the "room2" room
|
||||
io.of("/admin").in("room1").socketsLeave("room2");
|
||||
```
|
||||
|
||||
### `Emitter#disconnectSockets(close:boolean)`
|
||||
|
||||
Makes the matching socket instances disconnect:
|
||||
|
||||
```js
|
||||
// make all Socket instances disconnect
|
||||
io.disconnectSockets();
|
||||
|
||||
// make all Socket instances of the "admin" namespace in the "room1" room disconnect
|
||||
io.of("/admin").in("room1").disconnectSockets();
|
||||
|
||||
// this also works with a single socket ID
|
||||
io.of("/admin").in(theSocketId).disconnectSockets();
|
||||
```
|
||||
|
||||
### `Emitter#serverSideEmit(ev:string[,...args:any[]])`
|
||||
|
||||
Emits an event that will be received by each Socket.IO server of the cluster.
|
||||
|
||||
```js
|
||||
io.serverSideEmit("ping");
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
15
packages/socket.io-redis-streams-emitter/compose.yaml
Normal file
15
packages/socket.io-redis-streams-emitter/compose.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
services:
|
||||
redis:
|
||||
image: redis:5
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
redis-cluster:
|
||||
image: grokzen/redis-cluster:7.0.10
|
||||
ports:
|
||||
- "7000-7005:7000-7005"
|
||||
|
||||
valkey:
|
||||
image: valkey/valkey:8
|
||||
ports:
|
||||
- "6389:6379"
|
||||
@@ -0,0 +1,75 @@
|
||||
// imported from the 'socket.io-adapter' package
|
||||
export enum MessageType {
|
||||
INITIAL_HEARTBEAT = 1,
|
||||
HEARTBEAT,
|
||||
BROADCAST,
|
||||
SOCKETS_JOIN,
|
||||
SOCKETS_LEAVE,
|
||||
DISCONNECT_SOCKETS,
|
||||
FETCH_SOCKETS,
|
||||
FETCH_SOCKETS_RESPONSE,
|
||||
SERVER_SIDE_EMIT,
|
||||
SERVER_SIDE_EMIT_RESPONSE,
|
||||
BROADCAST_CLIENT_COUNT,
|
||||
BROADCAST_ACK,
|
||||
ADAPTER_CLOSE,
|
||||
}
|
||||
|
||||
export type ServerId = string;
|
||||
|
||||
export type ClusterMessage = {
|
||||
uid: ServerId;
|
||||
nsp: string;
|
||||
} & (
|
||||
| {
|
||||
type:
|
||||
| MessageType.INITIAL_HEARTBEAT
|
||||
| MessageType.HEARTBEAT
|
||||
| MessageType.ADAPTER_CLOSE;
|
||||
}
|
||||
| {
|
||||
type: MessageType.BROADCAST;
|
||||
data: {
|
||||
opts: { rooms: string[]; except: string[]; flags: BroadcastFlags };
|
||||
packet: unknown;
|
||||
requestId?: string;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: MessageType.SOCKETS_JOIN | MessageType.SOCKETS_LEAVE;
|
||||
data: {
|
||||
opts: { rooms: string[]; except: string[]; flags: BroadcastFlags };
|
||||
rooms: string[];
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: MessageType.DISCONNECT_SOCKETS;
|
||||
data: {
|
||||
opts: { rooms: string[]; except: string[]; flags: BroadcastFlags };
|
||||
close?: boolean;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: MessageType.FETCH_SOCKETS;
|
||||
data: {
|
||||
opts: { rooms: string[]; except: string[]; flags: BroadcastFlags };
|
||||
requestId: string;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: MessageType.SERVER_SIDE_EMIT;
|
||||
data: {
|
||||
requestId?: string;
|
||||
packet: any[];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export interface BroadcastFlags {
|
||||
volatile?: boolean;
|
||||
compress?: boolean;
|
||||
local?: boolean;
|
||||
broadcast?: boolean;
|
||||
binary?: boolean;
|
||||
timeout?: number;
|
||||
}
|
||||
496
packages/socket.io-redis-streams-emitter/lib/index.ts
Normal file
496
packages/socket.io-redis-streams-emitter/lib/index.ts
Normal file
@@ -0,0 +1,496 @@
|
||||
import debugModule from "debug";
|
||||
import type {
|
||||
DefaultEventsMap,
|
||||
EventNames,
|
||||
EventParams,
|
||||
EventsMap,
|
||||
TypedEventBroadcaster,
|
||||
} from "./typed-events";
|
||||
import { encode } from "@msgpack/msgpack";
|
||||
import { hasBinary, XADD } from "./util";
|
||||
import { ClusterMessage, MessageType, BroadcastFlags } from "./adapter-types";
|
||||
|
||||
const debug = debugModule("socket.io-redis-streams-emitter");
|
||||
const EMITTER_UID = "emitter";
|
||||
|
||||
type DistributiveOmit<T, K extends keyof any> = T extends any
|
||||
? Omit<T, K>
|
||||
: never;
|
||||
|
||||
// TODO move to the socket.io-adapter package
|
||||
abstract class BaseEmitter<
|
||||
EmitEvents extends EventsMap = DefaultEventsMap,
|
||||
ServerSideEvents extends EventsMap = DefaultEventsMap,
|
||||
> {
|
||||
protected abstract publish(
|
||||
message: DistributiveOmit<ClusterMessage, "uid" | "nsp">,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Emits to all clients.
|
||||
*
|
||||
* @return Always true
|
||||
* @public
|
||||
*/
|
||||
public emit<Ev extends EventNames<EmitEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<EmitEvents, Ev>
|
||||
): true {
|
||||
return this.newBroadcastOperator().emit(ev, ...args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Targets a room when emitting.
|
||||
*
|
||||
* @param room
|
||||
* @return BroadcastOperator
|
||||
* @public
|
||||
*/
|
||||
public to(
|
||||
room: string | string[],
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
return this.newBroadcastOperator().to(room);
|
||||
}
|
||||
|
||||
/**
|
||||
* Targets a room when emitting.
|
||||
*
|
||||
* @param room
|
||||
* @return BroadcastOperator
|
||||
* @public
|
||||
*/
|
||||
public in(
|
||||
room: string | string[],
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
return this.newBroadcastOperator().in(room);
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes a room when emitting.
|
||||
*
|
||||
* @param room
|
||||
* @return BroadcastOperator
|
||||
* @public
|
||||
*/
|
||||
public except(
|
||||
room: string | string[],
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
return this.newBroadcastOperator().except(room);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to
|
||||
* receive messages (because of network slowness or other issues, or because they’re connected through long polling
|
||||
* and is in the middle of a request-response cycle).
|
||||
*
|
||||
* @return BroadcastOperator
|
||||
* @public
|
||||
*/
|
||||
public get volatile(): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
return this.newBroadcastOperator().volatile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the compress flag.
|
||||
*
|
||||
* @param compress - if `true`, compresses the sending data
|
||||
* @return BroadcastOperator
|
||||
* @public
|
||||
*/
|
||||
public compress(
|
||||
compress: boolean,
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
return this.newBroadcastOperator().compress(compress);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the matching socket instances join the specified rooms
|
||||
*
|
||||
* @param rooms
|
||||
* @public
|
||||
*/
|
||||
public socketsJoin(rooms: string | string[]): void {
|
||||
return this.newBroadcastOperator().socketsJoin(rooms);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the matching socket instances leave the specified rooms
|
||||
*
|
||||
* @param rooms
|
||||
* @public
|
||||
*/
|
||||
public socketsLeave(rooms: string | string[]): void {
|
||||
return this.newBroadcastOperator().socketsLeave(rooms);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the matching socket instances disconnect
|
||||
*
|
||||
* @param close - whether to close the underlying connection
|
||||
* @public
|
||||
*/
|
||||
public disconnectSockets(close: boolean = false): void {
|
||||
return this.newBroadcastOperator().disconnectSockets(close);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a packet to the Socket.IO servers in the cluster
|
||||
*
|
||||
* @param ev - the event name
|
||||
* @param args - any number of serializable arguments
|
||||
*/
|
||||
public serverSideEmit<Ev extends EventNames<ServerSideEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<ServerSideEvents, Ev>
|
||||
): void {
|
||||
return this.newBroadcastOperator().serverSideEmit(ev, ...args);
|
||||
}
|
||||
|
||||
private newBroadcastOperator() {
|
||||
return new BroadcastOperator<EmitEvents, ServerSideEvents>((msg) =>
|
||||
this.publish(msg),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const RESERVED_EVENTS: ReadonlySet<string | Symbol> = new Set(<const>[
|
||||
"connect",
|
||||
"connect_error",
|
||||
"disconnect",
|
||||
"disconnecting",
|
||||
"newListener",
|
||||
"removeListener",
|
||||
]);
|
||||
|
||||
export class BroadcastOperator<
|
||||
EmitEvents extends EventsMap,
|
||||
ServerSideEvents extends EventsMap,
|
||||
> implements TypedEventBroadcaster<EmitEvents>
|
||||
{
|
||||
constructor(
|
||||
private readonly publish: (
|
||||
message: DistributiveOmit<ClusterMessage, "uid" | "nsp">,
|
||||
) => void,
|
||||
private readonly rooms: Set<string> = new Set<string>(),
|
||||
private readonly exceptRooms: Set<string> = new Set<string>(),
|
||||
private readonly flags: BroadcastFlags = {},
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Targets a room when emitting.
|
||||
*
|
||||
* @param room
|
||||
* @return a new BroadcastOperator instance
|
||||
* @public
|
||||
*/
|
||||
public to(
|
||||
room: string | string[],
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
const rooms = new Set(this.rooms);
|
||||
if (Array.isArray(room)) {
|
||||
room.forEach((r) => rooms.add(r));
|
||||
} else {
|
||||
rooms.add(room);
|
||||
}
|
||||
return new BroadcastOperator(
|
||||
this.publish,
|
||||
rooms,
|
||||
this.exceptRooms,
|
||||
this.flags,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Targets a room when emitting.
|
||||
*
|
||||
* @param room
|
||||
* @return a new BroadcastOperator instance
|
||||
* @public
|
||||
*/
|
||||
public in(
|
||||
room: string | string[],
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
return this.to(room);
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes a room when emitting.
|
||||
*
|
||||
* @param room
|
||||
* @return a new BroadcastOperator instance
|
||||
* @public
|
||||
*/
|
||||
public except(
|
||||
room: string | string[],
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
const exceptRooms = new Set(this.exceptRooms);
|
||||
if (Array.isArray(room)) {
|
||||
room.forEach((r) => exceptRooms.add(r));
|
||||
} else {
|
||||
exceptRooms.add(room);
|
||||
}
|
||||
return new BroadcastOperator(
|
||||
this.publish,
|
||||
this.rooms,
|
||||
exceptRooms,
|
||||
this.flags,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the compress flag.
|
||||
*
|
||||
* @param compress - if `true`, compresses the sending data
|
||||
* @return a new BroadcastOperator instance
|
||||
* @public
|
||||
*/
|
||||
public compress(
|
||||
compress: boolean,
|
||||
): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
const flags = Object.assign({}, this.flags, { compress });
|
||||
return new BroadcastOperator(
|
||||
this.publish,
|
||||
this.rooms,
|
||||
this.exceptRooms,
|
||||
flags,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to
|
||||
* receive messages (because of network slowness or other issues, or because they’re connected through long polling
|
||||
* and is in the middle of a request-response cycle).
|
||||
*
|
||||
* @return a new BroadcastOperator instance
|
||||
* @public
|
||||
*/
|
||||
public get volatile(): BroadcastOperator<EmitEvents, ServerSideEvents> {
|
||||
const flags = Object.assign({}, this.flags, { volatile: true });
|
||||
return new BroadcastOperator(
|
||||
this.publish,
|
||||
this.rooms,
|
||||
this.exceptRooms,
|
||||
flags,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emits to all clients.
|
||||
*
|
||||
* @return Always true
|
||||
* @public
|
||||
*/
|
||||
public emit<Ev extends EventNames<EmitEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<EmitEvents, Ev>
|
||||
): true {
|
||||
if (RESERVED_EVENTS.has(ev)) {
|
||||
throw new Error(`"${String(ev)}" is a reserved event name`);
|
||||
}
|
||||
|
||||
// set up packet object
|
||||
const data = [ev, ...args];
|
||||
const packet = {
|
||||
type: 2, // EVENT
|
||||
data: data,
|
||||
};
|
||||
|
||||
const opts = {
|
||||
rooms: [...this.rooms],
|
||||
flags: this.flags,
|
||||
except: [...this.exceptRooms],
|
||||
};
|
||||
|
||||
this.publish({
|
||||
type: MessageType.BROADCAST,
|
||||
data: {
|
||||
packet,
|
||||
opts,
|
||||
},
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the matching socket instances join the specified rooms
|
||||
*
|
||||
* @param rooms
|
||||
* @public
|
||||
*/
|
||||
public socketsJoin(rooms: string | string[]): void {
|
||||
this.publish({
|
||||
type: MessageType.SOCKETS_JOIN,
|
||||
data: {
|
||||
opts: {
|
||||
rooms: [...this.rooms],
|
||||
except: [...this.exceptRooms],
|
||||
flags: {},
|
||||
},
|
||||
rooms: Array.isArray(rooms) ? rooms : [rooms],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the matching socket instances leave the specified rooms
|
||||
*
|
||||
* @param rooms
|
||||
* @public
|
||||
*/
|
||||
public socketsLeave(rooms: string | string[]): void {
|
||||
this.publish({
|
||||
type: MessageType.SOCKETS_LEAVE,
|
||||
data: {
|
||||
opts: {
|
||||
rooms: [...this.rooms],
|
||||
except: [...this.exceptRooms],
|
||||
flags: {},
|
||||
},
|
||||
rooms: Array.isArray(rooms) ? rooms : [rooms],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the matching socket instances disconnect
|
||||
*
|
||||
* @param close - whether to close the underlying connection
|
||||
* @public
|
||||
*/
|
||||
public disconnectSockets(close: boolean = false): void {
|
||||
this.publish({
|
||||
type: MessageType.DISCONNECT_SOCKETS,
|
||||
data: {
|
||||
opts: {
|
||||
rooms: [...this.rooms],
|
||||
except: [...this.exceptRooms],
|
||||
flags: {},
|
||||
},
|
||||
close,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a packet to the Socket.IO servers in the cluster
|
||||
*
|
||||
* @param ev - the event name
|
||||
* @param args - any number of serializable arguments
|
||||
*/
|
||||
public serverSideEmit<Ev extends EventNames<ServerSideEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<ServerSideEvents, Ev>
|
||||
): void {
|
||||
const withAck = args.length && typeof args[args.length - 1] === "function";
|
||||
|
||||
if (withAck) {
|
||||
throw new Error("Acknowledgements are not supported");
|
||||
}
|
||||
|
||||
this.publish({
|
||||
type: MessageType.SERVER_SIDE_EMIT,
|
||||
data: {
|
||||
packet: [ev, ...args],
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function flattenPayload(message: ClusterMessage) {
|
||||
const rawMessage = {
|
||||
uid: message.uid,
|
||||
nsp: message.nsp,
|
||||
type: message.type.toString(),
|
||||
data: undefined as string | undefined,
|
||||
};
|
||||
|
||||
// @ts-expect-error
|
||||
const data = message.data;
|
||||
|
||||
if (data) {
|
||||
const mayContainBinary = [
|
||||
MessageType.BROADCAST,
|
||||
MessageType.FETCH_SOCKETS_RESPONSE,
|
||||
MessageType.SERVER_SIDE_EMIT,
|
||||
MessageType.SERVER_SIDE_EMIT_RESPONSE,
|
||||
MessageType.BROADCAST_ACK,
|
||||
].includes(message.type);
|
||||
|
||||
if (mayContainBinary && hasBinary(data)) {
|
||||
rawMessage.data = Buffer.from(encode(data)).toString("base64");
|
||||
} else {
|
||||
rawMessage.data = JSON.stringify(data);
|
||||
}
|
||||
}
|
||||
|
||||
return rawMessage;
|
||||
}
|
||||
|
||||
export interface RedisStreamsEmitterOptions {
|
||||
/**
|
||||
* The name of the Redis stream.
|
||||
* @default "socket.io"
|
||||
*/
|
||||
streamName?: string;
|
||||
/**
|
||||
* The maximum size of the stream. Almost exact trimming (~) is used.
|
||||
* @default 10_000
|
||||
*/
|
||||
maxLen?: number;
|
||||
}
|
||||
|
||||
export class Emitter<
|
||||
EmitEvents extends EventsMap = DefaultEventsMap,
|
||||
ServerSideEvents extends EventsMap = DefaultEventsMap,
|
||||
> extends BaseEmitter<EmitEvents, ServerSideEvents> {
|
||||
readonly #redisClient: any;
|
||||
readonly #opts: Required<RedisStreamsEmitterOptions>;
|
||||
readonly #nsp: string;
|
||||
|
||||
constructor(
|
||||
redisClient: any,
|
||||
opts: RedisStreamsEmitterOptions = {},
|
||||
nsp = "/",
|
||||
) {
|
||||
super();
|
||||
this.#redisClient = redisClient;
|
||||
this.#opts = Object.assign(
|
||||
{
|
||||
streamName: "socket.io",
|
||||
maxLen: 10_000,
|
||||
},
|
||||
opts,
|
||||
);
|
||||
this.#nsp = nsp;
|
||||
}
|
||||
|
||||
public of(nsp: string) {
|
||||
return new Emitter(this.#redisClient, this.#opts, nsp);
|
||||
}
|
||||
|
||||
protected override publish(
|
||||
message: DistributiveOmit<ClusterMessage, "uid" | "nsp">,
|
||||
) {
|
||||
(message as ClusterMessage).uid = EMITTER_UID;
|
||||
(message as ClusterMessage).nsp = this.#nsp;
|
||||
|
||||
debug(
|
||||
"publishing message %s to stream %s",
|
||||
message.type,
|
||||
this.#opts.streamName,
|
||||
);
|
||||
|
||||
if (message.type === MessageType.BROADCAST) {
|
||||
// @ts-expect-error FIXME untyped packet object
|
||||
message.data.packet.nsp = this.#nsp;
|
||||
}
|
||||
|
||||
return XADD(
|
||||
this.#redisClient,
|
||||
this.#opts.streamName,
|
||||
flattenPayload(message as ClusterMessage),
|
||||
this.#opts.maxLen,
|
||||
);
|
||||
}
|
||||
}
|
||||
37
packages/socket.io-redis-streams-emitter/lib/typed-events.ts
Normal file
37
packages/socket.io-redis-streams-emitter/lib/typed-events.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* An events map is an interface that maps event names to their value, which
|
||||
* represents the type of the `on` listener.
|
||||
*/
|
||||
export interface EventsMap {
|
||||
[event: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default events map, used if no EventsMap is given. Using this EventsMap
|
||||
* is equivalent to accepting all event names, and any data.
|
||||
*/
|
||||
export interface DefaultEventsMap {
|
||||
[event: string]: (...args: any[]) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a union type containing all the keys of an event map.
|
||||
*/
|
||||
export type EventNames<Map extends EventsMap> = keyof Map & (string | symbol);
|
||||
|
||||
/** The tuple type representing the parameters of an event listener */
|
||||
export type EventParams<
|
||||
Map extends EventsMap,
|
||||
Ev extends EventNames<Map>,
|
||||
> = Parameters<Map[Ev]>;
|
||||
|
||||
/**
|
||||
* Interface for classes that aren't `EventEmitter`s, but still expose a
|
||||
* strictly typed `emit` method.
|
||||
*/
|
||||
export interface TypedEventBroadcaster<EmitEvents extends EventsMap> {
|
||||
emit<Ev extends EventNames<EmitEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<EmitEvents, Ev>
|
||||
): boolean;
|
||||
}
|
||||
68
packages/socket.io-redis-streams-emitter/lib/util.ts
Normal file
68
packages/socket.io-redis-streams-emitter/lib/util.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
export function hasBinary(obj: any, toJSON?: boolean): boolean {
|
||||
if (!obj || typeof obj !== "object") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
for (let i = 0, l = obj.length; i < l; i++) {
|
||||
if (hasBinary(obj[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.toJSON && typeof obj.toJSON === "function" && !toJSON) {
|
||||
return hasBinary(obj.toJSON(), true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the client comes from the `redis` package
|
||||
*
|
||||
* @param redisClient
|
||||
*
|
||||
* @see https://github.com/redis/node-redis
|
||||
*/
|
||||
function isRedisV4Client(redisClient: any) {
|
||||
return typeof redisClient.sSubscribe === "function";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://redis.io/commands/xadd/
|
||||
*/
|
||||
export function XADD(
|
||||
redisClient: any,
|
||||
streamName: string,
|
||||
payload: any,
|
||||
maxLenThreshold: number,
|
||||
) {
|
||||
if (isRedisV4Client(redisClient)) {
|
||||
return redisClient.xAdd(streamName, "*", payload, {
|
||||
TRIM: {
|
||||
strategy: "MAXLEN",
|
||||
strategyModifier: "~",
|
||||
threshold: maxLenThreshold,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const args = [streamName, "MAXLEN", "~", maxLenThreshold, "*"];
|
||||
Object.keys(payload).forEach((k) => {
|
||||
args.push(k, payload[k]);
|
||||
});
|
||||
|
||||
return redisClient.xadd.call(redisClient, args);
|
||||
}
|
||||
}
|
||||
38
packages/socket.io-redis-streams-emitter/package.json
Normal file
38
packages/socket.io-redis-streams-emitter/package.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "@socket.io/redis-streams-emitter",
|
||||
"version": "0.1.1",
|
||||
"description": "The Socket.IO Redis streams emitter, allowing to communicate with a group of Socket.IO servers from another Node.js process",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/socketio/socket.io/tree/main/packages/socket.io-redis-streams-emitter#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/socketio/socket.io.git"
|
||||
},
|
||||
"files": [
|
||||
"dist/"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"compile": "rimraf ./dist && tsc",
|
||||
"format:check": "prettier --parser typescript --check 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
"format:fix": "prettier --parser typescript --write 'lib/**/*.ts' 'test/**/*.ts'",
|
||||
"prepack": "npm run compile",
|
||||
"test": "npm run format:check && npm run compile && npm run test:redis-standalone && npm run test:ioredis-standalone",
|
||||
"test:redis-standalone": "tsx --test",
|
||||
"test:redis-cluster": "REDIS_CLUSTER=1 npm run test:redis-standalone",
|
||||
"test:ioredis-standalone": "REDIS_LIB=ioredis npm run test:redis-standalone",
|
||||
"test:ioredis-cluster": "REDIS_LIB=ioredis REDIS_CLUSTER=1 npm run test:redis-standalone",
|
||||
"test:valkey-standalone": "VALKEY=1 npm run test:redis-standalone"
|
||||
},
|
||||
"dependencies": {
|
||||
"@msgpack/msgpack": "~2.8.0",
|
||||
"debug": "~4.4.1"
|
||||
},
|
||||
"keywords": [
|
||||
"socket.io",
|
||||
"redis",
|
||||
"redis-streams",
|
||||
"emitter"
|
||||
]
|
||||
}
|
||||
238
packages/socket.io-redis-streams-emitter/test/index.ts
Normal file
238
packages/socket.io-redis-streams-emitter/test/index.ts
Normal file
@@ -0,0 +1,238 @@
|
||||
import { describe, it, beforeEach, afterEach } from "node:test";
|
||||
import * as assert from "node:assert";
|
||||
import { type Server, type Socket as ServerSocket } from "socket.io";
|
||||
import { type Socket as ClientSocket } from "socket.io-client";
|
||||
import { times, sleep, setup, initRedisClient } from "./util";
|
||||
import { Emitter } from "../lib";
|
||||
|
||||
const PROPAGATION_DELAY_IN_MS = 100;
|
||||
|
||||
describe("@socket.io/redis-streams-emitter", () => {
|
||||
let servers: [Server, Server, Server],
|
||||
serverSockets: [ServerSocket, ServerSocket, ServerSocket],
|
||||
clientSockets: [ClientSocket, ClientSocket, ClientSocket],
|
||||
cleanup: () => void,
|
||||
emitter: Emitter;
|
||||
|
||||
beforeEach(async () => {
|
||||
const testContext = await setup();
|
||||
servers = testContext.servers;
|
||||
serverSockets = testContext.serverSockets;
|
||||
clientSockets = testContext.clientSockets;
|
||||
const redisClient = await initRedisClient();
|
||||
emitter = new Emitter(redisClient);
|
||||
|
||||
cleanup = () => {
|
||||
testContext.cleanup();
|
||||
redisClient.quit();
|
||||
};
|
||||
});
|
||||
|
||||
afterEach(() => cleanup());
|
||||
|
||||
describe("broadcast", function () {
|
||||
it("broadcasts to all clients", () => {
|
||||
return new Promise<void>((resolve) => {
|
||||
const partialResolve = times(3, resolve);
|
||||
|
||||
clientSockets.forEach((clientSocket) => {
|
||||
clientSocket.on("test", (arg1, arg2, arg3) => {
|
||||
assert.equal(arg1, 1);
|
||||
assert.equal(arg2, "2");
|
||||
assert.ok(Buffer.isBuffer(arg3));
|
||||
partialResolve();
|
||||
});
|
||||
});
|
||||
|
||||
emitter.emit("test", 1, "2", Buffer.from([3, 4]));
|
||||
});
|
||||
});
|
||||
|
||||
it("broadcasts to all clients in a namespace", () => {
|
||||
return new Promise<void>((resolve) => {
|
||||
const partialResolve = times(3, () => {
|
||||
servers.forEach((server) => server.of("/custom").adapter.close());
|
||||
resolve();
|
||||
});
|
||||
|
||||
servers.forEach((server) => server.of("/custom"));
|
||||
|
||||
const onConnect = times(3, async () => {
|
||||
await sleep(PROPAGATION_DELAY_IN_MS);
|
||||
|
||||
emitter.of("/custom").emit("test");
|
||||
});
|
||||
|
||||
clientSockets.forEach((clientSocket) => {
|
||||
const socket = clientSocket.io.socket("/custom");
|
||||
socket.on("connect", onConnect);
|
||||
socket.on("test", () => {
|
||||
socket.disconnect();
|
||||
partialResolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("broadcasts to all clients in a room", () => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
serverSockets[1].join("room1");
|
||||
|
||||
clientSockets[0].on("test", () => {
|
||||
reject("should not happen");
|
||||
});
|
||||
|
||||
clientSockets[1].on("test", () => {
|
||||
resolve();
|
||||
});
|
||||
|
||||
clientSockets[2].on("test", () => {
|
||||
reject("should not happen");
|
||||
});
|
||||
|
||||
emitter.to("room1").emit("test");
|
||||
});
|
||||
});
|
||||
|
||||
it("broadcasts to all clients except in room", () => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const partialResolve = times(2, resolve);
|
||||
serverSockets[1].join("room1");
|
||||
|
||||
clientSockets[0].on("test", () => {
|
||||
partialResolve();
|
||||
});
|
||||
|
||||
clientSockets[1].on("test", () => {
|
||||
reject("should not happen");
|
||||
});
|
||||
|
||||
clientSockets[2].on("test", () => {
|
||||
partialResolve();
|
||||
});
|
||||
|
||||
emitter.of("/").except("room1").emit("test");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("socketsJoin", () => {
|
||||
it("makes all socket instances join the specified room", async () => {
|
||||
emitter.socketsJoin("room1");
|
||||
|
||||
await sleep(PROPAGATION_DELAY_IN_MS);
|
||||
|
||||
assert.ok(serverSockets[0].rooms.has("room1"));
|
||||
assert.ok(serverSockets[1].rooms.has("room1"));
|
||||
assert.ok(serverSockets[2].rooms.has("room1"));
|
||||
});
|
||||
|
||||
it("makes the matching socket instances join the specified room", async () => {
|
||||
serverSockets[0].join("room1");
|
||||
serverSockets[2].join("room1");
|
||||
|
||||
emitter.in("room1").socketsJoin("room2");
|
||||
|
||||
await sleep(PROPAGATION_DELAY_IN_MS);
|
||||
|
||||
assert.ok(serverSockets[0].rooms.has("room2"));
|
||||
assert.ok(serverSockets[1].rooms.has("room2") === false);
|
||||
assert.ok(serverSockets[2].rooms.has("room2"));
|
||||
});
|
||||
|
||||
it("makes the given socket instance join the specified room", async () => {
|
||||
emitter.in(serverSockets[1].id).socketsJoin("room3");
|
||||
|
||||
await sleep(PROPAGATION_DELAY_IN_MS);
|
||||
|
||||
assert.ok(serverSockets[0].rooms.has("room3") === false);
|
||||
assert.ok(serverSockets[1].rooms.has("room3"));
|
||||
assert.ok(serverSockets[2].rooms.has("room3") === false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("socketsLeave", () => {
|
||||
it("makes all socket instances leave the specified room", async () => {
|
||||
serverSockets[0].join("room1");
|
||||
serverSockets[2].join("room1");
|
||||
|
||||
emitter.socketsLeave("room1");
|
||||
|
||||
await sleep(PROPAGATION_DELAY_IN_MS);
|
||||
|
||||
assert.ok(serverSockets[0].rooms.has("room1") === false);
|
||||
assert.ok(serverSockets[1].rooms.has("room1") === false);
|
||||
assert.ok(serverSockets[2].rooms.has("room1") === false);
|
||||
});
|
||||
|
||||
it("makes the matching socket instances leave the specified room", async () => {
|
||||
serverSockets[0].join(["room1", "room2"]);
|
||||
serverSockets[1].join(["room1", "room2"]);
|
||||
serverSockets[2].join(["room2"]);
|
||||
|
||||
emitter.in("room1").socketsLeave("room2");
|
||||
|
||||
await sleep(PROPAGATION_DELAY_IN_MS);
|
||||
|
||||
assert.ok(serverSockets[0].rooms.has("room2") === false);
|
||||
assert.ok(serverSockets[1].rooms.has("room2") === false);
|
||||
assert.ok(serverSockets[2].rooms.has("room2"));
|
||||
});
|
||||
|
||||
it("makes the given socket instance leave the specified room", async () => {
|
||||
serverSockets[0].join("room3");
|
||||
serverSockets[1].join("room3");
|
||||
serverSockets[2].join("room3");
|
||||
|
||||
emitter.in(serverSockets[1].id).socketsLeave("room3");
|
||||
|
||||
await sleep(PROPAGATION_DELAY_IN_MS);
|
||||
|
||||
assert.ok(serverSockets[0].rooms.has("room3"));
|
||||
assert.ok(serverSockets[1].rooms.has("room1") === false);
|
||||
assert.ok(serverSockets[2].rooms.has("room3"));
|
||||
});
|
||||
});
|
||||
|
||||
describe("disconnectSockets", () => {
|
||||
it("makes all socket instances disconnect", () => {
|
||||
return new Promise<void>((resolve) => {
|
||||
const partialResolve = times(3, resolve);
|
||||
|
||||
clientSockets.forEach((clientSocket) => {
|
||||
clientSocket.on("disconnect", (reason) => {
|
||||
assert.equal(reason, "io server disconnect");
|
||||
partialResolve();
|
||||
});
|
||||
});
|
||||
|
||||
emitter.disconnectSockets();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("serverSideEmit", () => {
|
||||
it("sends an event to other server instances", () => {
|
||||
return new Promise<void>((resolve) => {
|
||||
const partialResolve = times(3, resolve);
|
||||
|
||||
emitter.serverSideEmit("hello", "world", 1, "2");
|
||||
|
||||
servers[0].on("hello", (arg1, arg2, arg3) => {
|
||||
assert.equal(arg1, "world");
|
||||
assert.equal(arg2, 1);
|
||||
assert.equal(arg3, "2");
|
||||
partialResolve();
|
||||
});
|
||||
|
||||
servers[1].on("hello", (arg1, arg2, arg3) => {
|
||||
partialResolve();
|
||||
});
|
||||
|
||||
servers[2].of("/").on("hello", () => {
|
||||
partialResolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
164
packages/socket.io-redis-streams-emitter/test/util.ts
Normal file
164
packages/socket.io-redis-streams-emitter/test/util.ts
Normal file
@@ -0,0 +1,164 @@
|
||||
import { createServer } from "node:http";
|
||||
import { type AddressInfo } from "node:net";
|
||||
import { createClient, createCluster } from "redis";
|
||||
import { Redis, Cluster } from "ioredis";
|
||||
import { Server, type Socket as ServerSocket } from "socket.io";
|
||||
import { io as ioc, type Socket as ClientSocket } from "socket.io-client";
|
||||
import { createAdapter } from "@socket.io/redis-streams-adapter";
|
||||
|
||||
export function times(count: number, fn: () => void) {
|
||||
let i = 0;
|
||||
return () => {
|
||||
i++;
|
||||
if (i === count) {
|
||||
fn();
|
||||
} else if (i > count) {
|
||||
throw new Error(`too many calls: ${i} instead of ${count}`);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function sleep(duration: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, duration));
|
||||
}
|
||||
|
||||
const mode = process.env.REDIS_CLUSTER === "1" ? "cluster" : "standalone";
|
||||
const lib = process.env.REDIS_LIB || "redis";
|
||||
|
||||
console.log(`[INFO] testing in ${mode} mode with ${lib}`);
|
||||
|
||||
export async function initRedisClient() {
|
||||
if (mode === "cluster") {
|
||||
if (lib === "ioredis") {
|
||||
return new Cluster([
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7000,
|
||||
},
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7001,
|
||||
},
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7002,
|
||||
},
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7003,
|
||||
},
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7004,
|
||||
},
|
||||
{
|
||||
host: "localhost",
|
||||
port: 7005,
|
||||
},
|
||||
]);
|
||||
} else {
|
||||
const redisClient = createCluster({
|
||||
rootNodes: [
|
||||
{
|
||||
url: "redis://localhost:7000",
|
||||
},
|
||||
{
|
||||
url: "redis://localhost:7001",
|
||||
},
|
||||
{
|
||||
url: "redis://localhost:7002",
|
||||
},
|
||||
{
|
||||
url: "redis://localhost:7003",
|
||||
},
|
||||
{
|
||||
url: "redis://localhost:7004",
|
||||
},
|
||||
{
|
||||
url: "redis://localhost:7005",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
await redisClient.connect();
|
||||
|
||||
return redisClient;
|
||||
}
|
||||
} else {
|
||||
if (lib === "ioredis") {
|
||||
return new Redis();
|
||||
} else {
|
||||
const port = process.env.VALKEY === "1" ? 6389 : 6379;
|
||||
const redisClient = createClient({
|
||||
url: `redis://localhost:${port}`,
|
||||
});
|
||||
await redisClient.connect();
|
||||
|
||||
return redisClient;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function init() {
|
||||
const redisClient = await initRedisClient();
|
||||
|
||||
const httpServer = createServer();
|
||||
const io = new Server(httpServer, {
|
||||
adapter: createAdapter(redisClient, {
|
||||
readCount: 1, // return as soon as possible
|
||||
}),
|
||||
});
|
||||
|
||||
return new Promise<{
|
||||
io: Server;
|
||||
socket: ServerSocket;
|
||||
clientSocket: ClientSocket;
|
||||
cleanup: () => void;
|
||||
}>((resolve) => {
|
||||
httpServer.listen(() => {
|
||||
const port = (httpServer.address() as AddressInfo).port;
|
||||
const clientSocket = ioc(`http://localhost:${port}`);
|
||||
|
||||
io.on("connection", async (socket) => {
|
||||
resolve({
|
||||
io,
|
||||
socket,
|
||||
clientSocket,
|
||||
cleanup: () => {
|
||||
io.close();
|
||||
clientSocket.disconnect();
|
||||
redisClient.quit();
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function setup() {
|
||||
const results = await Promise.all([init(), init(), init()]);
|
||||
|
||||
const servers = results.map(({ io }) => io) as [Server, Server, Server];
|
||||
const serverSockets = results.map(({ socket }) => socket) as [
|
||||
ServerSocket,
|
||||
ServerSocket,
|
||||
ServerSocket,
|
||||
];
|
||||
const clientSockets = results.map(({ clientSocket }) => clientSocket) as [
|
||||
ClientSocket,
|
||||
ClientSocket,
|
||||
ClientSocket,
|
||||
];
|
||||
const cleanupMethods = results.map(({ cleanup }) => cleanup);
|
||||
|
||||
return {
|
||||
servers,
|
||||
serverSockets,
|
||||
clientSockets,
|
||||
cleanup: () => {
|
||||
for (const cleanup of cleanupMethods) {
|
||||
cleanup();
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
13
packages/socket.io-redis-streams-emitter/tsconfig.json
Normal file
13
packages/socket.io-redis-streams-emitter/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"allowJs": false,
|
||||
"target": "es2022",
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": [
|
||||
"./lib/**/*"
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
# History
|
||||
# Changelog
|
||||
|
||||
| Version | Release date |
|
||||
|--------------------------------------------------------------------------------------------------|----------------|
|
||||
| [4.8.2](#482-2025-12-22) | December 2025 |
|
||||
| [4.8.1](#481-2024-10-25) | October 2024 |
|
||||
| [4.8.0](#480-2024-09-21) | September 2024 |
|
||||
| [4.7.5](#475-2024-03-14) | March 2024 |
|
||||
@@ -49,7 +50,22 @@
|
||||
| [2.1.0](#210-2018-03-29) | March 2018 |
|
||||
|
||||
|
||||
# Release notes
|
||||
## [4.8.2](https://github.com/socketio/socket.io/compare/socket.io@4.8.1...socket.io@4.8.2) (2025-12-22)
|
||||
|
||||
The `url.parse()` function is now deprecated and has been replaced by `new URL()` (see [8af7019](https://github.com/socketio/socket.io/commit/8af70195bb8c5bc3efe9685997ab6373fb8b1ca9)).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* call adapter.init() when creating each namespace ([f3e1f5e](https://github.com/socketio/socket.io/commit/f3e1f5ebdf59158d0c8d1e20f8230275617fb355))
|
||||
* improve `io.close()` function ([#5344](https://github.com/socketio/socket.io/issues/5344)) ([bb0b480](https://github.com/socketio/socket.io/commit/bb0b480d2ab3108a8ae255b539015da451fdb249))
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
- [`engine.io@~6.6.0`](https://github.com/socketio/engine.io/releases/tag/6.6.0) (no change)
|
||||
- [`ws@~8.18.3`](https://github.com/websockets/ws/releases/tag/8.18.3) ([diff](https://github.com/websockets/ws/compare/8.17.1...8.18.3))
|
||||
|
||||
|
||||
|
||||
## [4.8.1](https://github.com/socketio/socket.io/compare/socket.io@4.8.0...socket.io@4.8.1) (2024-10-25)
|
||||
|
||||
|
||||
8
packages/socket.io/RELEASING.md
Normal file
8
packages/socket.io/RELEASING.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Releasing
|
||||
|
||||
1. Update the version in `package.json`
|
||||
2. Update the changelog `CHANGELOG.md` with `conventional-changelog -p angular`
|
||||
3. Copy the bundles from the client project to `client-dist/`
|
||||
4. Commit the changes in `package.json`, `CHANGELOG.md` and `client-dist/`
|
||||
5. Create the tag `socket.io@x.y.z` and push it to the GitHub repository. The workflow `.github/workflows/publish.yml` will safely publish the package to npm using trusted publishing.
|
||||
6. Create a new release at https://github.com/socketio/socket.io/releases
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Socket.IO v4.8.1
|
||||
* (c) 2014-2024 Guillermo Rauch
|
||||
* Socket.IO v4.8.2
|
||||
* (c) 2014-2025 Guillermo Rauch
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
(function (global, factory) {
|
||||
@@ -899,7 +899,7 @@
|
||||
return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
|
||||
};
|
||||
_proto._port = function _port() {
|
||||
if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {
|
||||
if (this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80)) {
|
||||
return ":" + this.opts.port;
|
||||
} else {
|
||||
return "";
|
||||
@@ -2669,21 +2669,65 @@
|
||||
createDebug.namespaces = namespaces;
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
var i;
|
||||
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
||||
var len = split.length;
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!split[i]) {
|
||||
// ignore empty strings
|
||||
continue;
|
||||
var split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(/\s+/g, ',').split(',').filter(Boolean);
|
||||
var _iterator = _createForOfIteratorHelper(split),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var ns = _step.value;
|
||||
if (ns[0] === '-') {
|
||||
createDebug.skips.push(ns.slice(1));
|
||||
} else {
|
||||
createDebug.names.push(ns);
|
||||
}
|
||||
}
|
||||
namespaces = split[i].replace(/\*/g, '.*?');
|
||||
if (namespaces[0] === '-') {
|
||||
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given string matches a namespace template, honoring
|
||||
* asterisks as wildcards.
|
||||
*
|
||||
* @param {String} search
|
||||
* @param {String} template
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function matchesTemplate(search, template) {
|
||||
var searchIndex = 0;
|
||||
var templateIndex = 0;
|
||||
var starIndex = -1;
|
||||
var matchIndex = 0;
|
||||
while (searchIndex < search.length) {
|
||||
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
||||
// Match character or proceed with wildcard
|
||||
if (template[templateIndex] === '*') {
|
||||
starIndex = templateIndex;
|
||||
matchIndex = searchIndex;
|
||||
templateIndex++; // Skip the '*'
|
||||
} else {
|
||||
searchIndex++;
|
||||
templateIndex++;
|
||||
}
|
||||
} else if (starIndex !== -1) {
|
||||
// eslint-disable-line no-negated-condition
|
||||
// Backtrack to the last '*' and try to match more characters
|
||||
templateIndex = starIndex + 1;
|
||||
matchIndex++;
|
||||
searchIndex = matchIndex;
|
||||
} else {
|
||||
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
||||
return false; // No match
|
||||
}
|
||||
}
|
||||
|
||||
// Handle trailing '*' in template
|
||||
while (templateIndex < template.length && template[templateIndex] === '*') {
|
||||
templateIndex++;
|
||||
}
|
||||
return templateIndex === template.length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2693,7 +2737,7 @@
|
||||
* @api public
|
||||
*/
|
||||
function disable() {
|
||||
var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
|
||||
var namespaces = [].concat(_toConsumableArray(createDebug.names), _toConsumableArray(createDebug.skips.map(function (namespace) {
|
||||
return '-' + namespace;
|
||||
}))).join(',');
|
||||
createDebug.enable('');
|
||||
@@ -2708,35 +2752,37 @@
|
||||
* @api public
|
||||
*/
|
||||
function enabled(name) {
|
||||
if (name[name.length - 1] === '*') {
|
||||
return true;
|
||||
}
|
||||
var i;
|
||||
var len;
|
||||
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
||||
if (createDebug.skips[i].test(name)) {
|
||||
return false;
|
||||
var _iterator2 = _createForOfIteratorHelper(createDebug.skips),
|
||||
_step2;
|
||||
try {
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
var skip = _step2.value;
|
||||
if (matchesTemplate(name, skip)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
||||
if (createDebug.names[i].test(name)) {
|
||||
return true;
|
||||
var _iterator3 = _createForOfIteratorHelper(createDebug.names),
|
||||
_step3;
|
||||
try {
|
||||
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
||||
var ns = _step3.value;
|
||||
if (matchesTemplate(name, ns)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator3.e(err);
|
||||
} finally {
|
||||
_iterator3.f();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert regexp to namespace
|
||||
*
|
||||
* @param {RegExp} regxep
|
||||
* @return {String} namespace
|
||||
* @api private
|
||||
*/
|
||||
function toNamespace(regexp) {
|
||||
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce `val`.
|
||||
*
|
||||
@@ -2812,15 +2858,17 @@
|
||||
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
||||
return false;
|
||||
}
|
||||
var m;
|
||||
|
||||
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||
// eslint-disable-next-line no-return-assign
|
||||
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
||||
// Is firebug? http://stackoverflow.com/a/398120/376773
|
||||
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
||||
// Is firefox >= v31?
|
||||
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 ||
|
||||
// Double check webkit in userAgent just in case we are in a worker
|
||||
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
||||
}
|
||||
@@ -2896,7 +2944,7 @@
|
||||
function load() {
|
||||
var r;
|
||||
try {
|
||||
r = exports.storage.getItem('debug');
|
||||
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG');
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
@@ -3828,8 +3876,7 @@
|
||||
};
|
||||
args.push(function (err) {
|
||||
if (packet !== _this4._queue[0]) {
|
||||
// the packet has already been acknowledged
|
||||
return;
|
||||
return debug$2("packet [%d] already acknowledged", packet.id);
|
||||
}
|
||||
var hasError = err !== null;
|
||||
if (hasError) {
|
||||
@@ -4100,8 +4147,8 @@
|
||||
this._pid = pid; // defined only if connection state recovery is enabled
|
||||
this.connected = true;
|
||||
this.emitBuffered();
|
||||
this.emitReserved("connect");
|
||||
this._drainQueue(true);
|
||||
this.emitReserved("connect");
|
||||
}
|
||||
/**
|
||||
* Emit buffered events (received and emitted).
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -267,16 +267,7 @@ export class Client<
|
||||
* @private
|
||||
*/
|
||||
private ondecoded(packet: Packet): void {
|
||||
let namespace: string;
|
||||
let authPayload: Record<string, unknown>;
|
||||
if (this.conn.protocol === 3) {
|
||||
const parsed = url.parse(packet.nsp, true);
|
||||
namespace = parsed.pathname!;
|
||||
authPayload = parsed.query;
|
||||
} else {
|
||||
namespace = packet.nsp;
|
||||
authPayload = packet.data;
|
||||
}
|
||||
const { namespace, authPayload } = this._parseNamespace(packet);
|
||||
const socket = this.nsps.get(namespace);
|
||||
|
||||
if (!socket && packet.type === PacketType.CONNECT) {
|
||||
@@ -295,6 +286,20 @@ export class Client<
|
||||
}
|
||||
}
|
||||
|
||||
private _parseNamespace(packet: Packet) {
|
||||
if (this.conn.protocol !== 3) {
|
||||
return {
|
||||
namespace: packet.nsp,
|
||||
authPayload: packet.data,
|
||||
};
|
||||
}
|
||||
const url = new URL(packet.nsp, "https://socket.io");
|
||||
return {
|
||||
namespace: url.pathname,
|
||||
authPayload: Object.fromEntries(url.searchParams.entries()),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles an error.
|
||||
*
|
||||
|
||||
@@ -831,7 +831,16 @@ export class Server<
|
||||
restoreAdapter();
|
||||
|
||||
if (this.httpServer) {
|
||||
this.httpServer.close(fn);
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
this.httpServer.close((err) => {
|
||||
fn && fn(err);
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
fn && fn();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "socket.io",
|
||||
"version": "4.8.1",
|
||||
"version": "4.8.2",
|
||||
"description": "node.js realtime framework server",
|
||||
"keywords": [
|
||||
"realtime",
|
||||
@@ -26,9 +26,12 @@
|
||||
"type": "commonjs",
|
||||
"main": "./dist/index.js",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./wrapper.mjs",
|
||||
"require": "./dist/index.js"
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./wrapper.mjs",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"types": "./dist/index.d.ts",
|
||||
"license": "MIT",
|
||||
@@ -44,7 +47,7 @@
|
||||
"compile": "rimraf ./dist && tsc",
|
||||
"test": "npm run format:check && npm run compile && npm run test:types && npm run test:unit",
|
||||
"test:types": "tsd",
|
||||
"test:unit": "nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts",
|
||||
"test:unit": "nyc mocha --import=tsx --reporter spec --slow 200 --bail --timeout 10000 test/index.ts",
|
||||
"format:check": "prettier --check \"lib/**/*.ts\" \"test/**/*.ts\"",
|
||||
"format:fix": "prettier --write \"lib/**/*.ts\" \"test/**/*.ts\"",
|
||||
"prepack": "npm run compile"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { getPort, successFn } from "./support/util";
|
||||
|
||||
describe("server attachment", () => {
|
||||
describe("http.Server", () => {
|
||||
const clientVersion = require("socket.io-client/package.json").version;
|
||||
const clientVersion = require("../package.json").version;
|
||||
|
||||
const testSource = (filename) => (done) => {
|
||||
const srv = createServer();
|
||||
|
||||
@@ -229,7 +229,7 @@ describe("socket.io with uWebSocket.js-based engine", () => {
|
||||
});
|
||||
|
||||
it("should serve static files", (done) => {
|
||||
const clientVersion = require("socket.io-client/package.json").version;
|
||||
const clientVersion = require("../package.json").version;
|
||||
|
||||
request(`http://localhost:${port}`)
|
||||
.get("/socket.io/socket.io.js")
|
||||
|
||||
Reference in New Issue
Block a user