mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-11 16:08:24 -05:00
Compare commits
13 Commits
socket.io@
...
socket.io-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d5528aa2a | ||
|
|
71387e5294 | ||
|
|
aead83560d | ||
|
|
029e010901 | ||
|
|
4ca6ddb3a2 | ||
|
|
ca9e994815 | ||
|
|
4865f2e62e | ||
|
|
d4b3ddedff | ||
|
|
3b68658201 | ||
|
|
175a2c58c1 | ||
|
|
9b80ab42d6 | ||
|
|
a5d2368512 | ||
|
|
88efd446f1 |
2
.github/workflows/build-examples.yml
vendored
2
.github/workflows/build-examples.yml
vendored
@@ -19,6 +19,8 @@ jobs:
|
||||
- custom-parsers
|
||||
- typescript-example/cjs
|
||||
- typescript-example/esm
|
||||
- typescript-client-example/cjs
|
||||
- typescript-client-example/esm
|
||||
- webpack-build
|
||||
- webpack-build-server
|
||||
- basic-crud-application/angular-client
|
||||
|
||||
4
.github/workflows/ci-browser.yml
vendored
4
.github/workflows/ci-browser.yml
vendored
@@ -2,13 +2,13 @@ name: CI (browser)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
paths:
|
||||
- 'packages/engine.io-parser/**'
|
||||
- 'packages/engine.io-client/**'
|
||||
- 'packages/socket.io-parser/**'
|
||||
- 'packages/socket.io-client/**'
|
||||
tags-ignore:
|
||||
- '**@*'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -2,8 +2,8 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
tags-ignore:
|
||||
- '**@*'
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
@@ -22,6 +22,7 @@ jobs:
|
||||
node-version:
|
||||
- 18
|
||||
- 20
|
||||
- 22
|
||||
|
||||
services:
|
||||
redis:
|
||||
@@ -59,3 +60,7 @@ jobs:
|
||||
- name: Run tests with fetch instead of XHR (engine.io-client)
|
||||
run: npm run test:node-fetch --workspace=engine.io-client
|
||||
if: ${{ matrix.node-version == '18' }}
|
||||
|
||||
- name: Run tests with Node.js native WebSocket (engine.io-client)
|
||||
run: npm run test:node-builtin-ws --workspace=engine.io-client
|
||||
if: ${{ matrix.node-version == '22' }}
|
||||
|
||||
@@ -20,17 +20,18 @@ export default defineNitroPlugin((nitroApp: NitroApp) => {
|
||||
},
|
||||
websocket: {
|
||||
open(peer) {
|
||||
const nodeContext = peer.ctx.node;
|
||||
const req = nodeContext.req;
|
||||
// crossws >= 0.3.0
|
||||
// @ts-expect-error private method and property
|
||||
engine.prepare(peer._internal.nodeReq);
|
||||
// @ts-expect-error private method and property
|
||||
engine.onWebSocket(peer._internal.nodeReq, peer._internal.nodeReq.socket, peer.websocket);
|
||||
|
||||
// @ts-expect-error private method
|
||||
engine.prepare(req);
|
||||
|
||||
const rawSocket = nodeContext.req.socket;
|
||||
const websocket = nodeContext.ws;
|
||||
|
||||
// @ts-expect-error private method
|
||||
engine.onWebSocket(req, rawSocket, websocket);
|
||||
// crossws < 0.3.0
|
||||
// const context = peer.ctx.node;
|
||||
// // @ts-expect-error private method
|
||||
// engine.prepare(context.req);
|
||||
// // @ts-expect-error private method
|
||||
// engine.onWebSocket(context.req, context.req.socket, context.ws);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
30
examples/typescript-client-example/cjs/client.ts
Normal file
30
examples/typescript-client-example/cjs/client.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { io, type Socket } from "socket.io-client";
|
||||
|
||||
interface ServerToClientEvents {
|
||||
hello: (val: string) => void;
|
||||
}
|
||||
|
||||
interface ClientToServerEvents {
|
||||
ping: (cb: () => void) => void;
|
||||
}
|
||||
|
||||
const socket: Socket<ServerToClientEvents, ClientToServerEvents> = io("ws://localhost:8080/");
|
||||
|
||||
socket.on("connect", () => {
|
||||
console.log(`connect ${socket.id}`);
|
||||
});
|
||||
|
||||
socket.on("hello", (val) => {
|
||||
console.log(`got ${val}`);
|
||||
});
|
||||
|
||||
socket.on("disconnect", () => {
|
||||
console.log(`disconnect`);
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
const start = Date.now();
|
||||
socket.emit("ping", () => {
|
||||
console.log(`pong (latency: ${Date.now() - start} ms)`);
|
||||
});
|
||||
}, 1000);
|
||||
17
examples/typescript-client-example/cjs/package.json
Normal file
17
examples/typescript-client-example/cjs/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "typescript-client-example-cjs",
|
||||
"version": "0.0.1",
|
||||
"description": "An example with TypeScript",
|
||||
"type": "commonjs",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "ts-node client.ts"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"socket.io-client": "^4.8.0",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
9
examples/typescript-client-example/cjs/tsconfig.json
Normal file
9
examples/typescript-client-example/cjs/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"target": "es2022",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
30
examples/typescript-client-example/esm/client.ts
Normal file
30
examples/typescript-client-example/esm/client.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { io, type Socket } from "socket.io-client";
|
||||
|
||||
interface ServerToClientEvents {
|
||||
hello: (val: string) => void;
|
||||
}
|
||||
|
||||
interface ClientToServerEvents {
|
||||
ping: (cb: () => void) => void;
|
||||
}
|
||||
|
||||
const socket: Socket<ServerToClientEvents, ClientToServerEvents> = io("ws://localhost:8080/");
|
||||
|
||||
socket.on("connect", () => {
|
||||
console.log(`connect ${socket.id}`);
|
||||
});
|
||||
|
||||
socket.on("hello", (val) => {
|
||||
console.log(`got ${val}`);
|
||||
});
|
||||
|
||||
socket.on("disconnect", () => {
|
||||
console.log(`disconnect`);
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
const start = Date.now();
|
||||
socket.emit("ping", () => {
|
||||
console.log(`pong (latency: ${Date.now() - start} ms)`);
|
||||
});
|
||||
}, 1000);
|
||||
17
examples/typescript-client-example/esm/package.json
Normal file
17
examples/typescript-client-example/esm/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "typescript-client-example-esm",
|
||||
"version": "0.0.1",
|
||||
"description": "An example with TypeScript",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "node --no-warnings=ExperimentalWarning --loader ts-node/esm client.ts"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"socket.io-client": "^4.8.0",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
9
examples/typescript-client-example/esm/tsconfig.json
Normal file
9
examples/typescript-client-example/esm/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"target": "es2022",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
393
package-lock.json
generated
393
package-lock.json
generated
@@ -21,7 +21,8 @@
|
||||
"@babel/plugin-transform-object-assign": "^7.24.7",
|
||||
"@babel/preset-env": "^7.24.7",
|
||||
"@babel/register": "^7.24.6",
|
||||
"@fails-components/webtransport": "^0.1.7",
|
||||
"@fails-components/webtransport": "^1.1.4",
|
||||
"@fails-components/webtransport-transport-http3-quiche": "^1.1.4",
|
||||
"@rollup/plugin-alias": "^5.1.0",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^26.0.1",
|
||||
@@ -1836,18 +1837,35 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@fails-components/webtransport": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@fails-components/webtransport/-/webtransport-0.1.7.tgz",
|
||||
"integrity": "sha512-RD8kGxFVSBElx7Y/ApskD1/t8kXF4GNtvveJnnMET8TAd6FfcEmtETvzJax5o7KyvGONsoVlCtLRY6s12ncn4w==",
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@fails-components/webtransport/-/webtransport-1.1.4.tgz",
|
||||
"integrity": "sha512-cFc9XhEREi+afRRl9S9c/xNQ3KVi9dZkaIRVq3xPGwjjezgX5QMQ1pJKG6iZffSwboOOjk1VrDwlvPjuVwtGwQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/debug": "^4.1.7",
|
||||
"bindings": "^1.5.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.5"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@types/debug": "^4.1.7",
|
||||
"bindings": "^1.5.0",
|
||||
"node-addon-api": "^4.3.0",
|
||||
"cmake-js": "^7.2.1",
|
||||
"debug": "^4.3.4",
|
||||
"node-addon-api": "^7.0.0",
|
||||
"prebuild-install": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=16.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@ioredis/commands": {
|
||||
@@ -4149,6 +4167,12 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/aproba": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
|
||||
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/archiver": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz",
|
||||
@@ -4406,6 +4430,34 @@
|
||||
"integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/are-we-there-yet": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz",
|
||||
"integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==",
|
||||
"deprecated": "This package is no longer supported.",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"delegates": "^1.0.0",
|
||||
"readable-stream": "^3.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/are-we-there-yet/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
@@ -4496,6 +4548,17 @@
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.7.7",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
|
||||
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/b4a": {
|
||||
"version": "1.6.6",
|
||||
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz",
|
||||
@@ -5445,6 +5508,45 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cmake-js": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/cmake-js/-/cmake-js-7.3.0.tgz",
|
||||
"integrity": "sha512-dXs2zq9WxrV87bpJ+WbnGKv8WUBXDw8blNiwNHoRe/it+ptscxhQHKB1SJXa1w+kocLMeP28Tk4/eTCezg4o+w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"axios": "^1.6.5",
|
||||
"debug": "^4",
|
||||
"fs-extra": "^11.2.0",
|
||||
"lodash.isplainobject": "^4.0.6",
|
||||
"memory-stream": "^1.0.0",
|
||||
"node-api-headers": "^1.1.0",
|
||||
"npmlog": "^6.0.2",
|
||||
"rc": "^1.2.7",
|
||||
"semver": "^7.5.4",
|
||||
"tar": "^6.2.0",
|
||||
"url-join": "^4.0.1",
|
||||
"which": "^2.0.2",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"bin": {
|
||||
"cmake-js": "bin/cmake-js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.15.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cmake-js/node_modules/semver": {
|
||||
"version": "7.6.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
|
||||
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
@@ -5460,6 +5562,15 @@
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/color-support": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
|
||||
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"color-support": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
@@ -5605,6 +5716,12 @@
|
||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/constant-case": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz",
|
||||
@@ -5644,9 +5761,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
|
||||
"integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==",
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
@@ -6071,6 +6188,12 @@
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/delegates": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/denque": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz",
|
||||
@@ -7505,6 +7628,26 @@
|
||||
"integrity": "sha512-3VELfuWCLVzt5d2Gblk8qcqFro6nuwvxwMzHaENVDHI7rxcBRtMCwTk/E9FXcgh+82DSpavPNDueA9+RxXJoFg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/foreground-child": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz",
|
||||
@@ -7625,6 +7768,36 @@
|
||||
"node": ">=14.14"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-minipass": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
|
||||
"integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minipass": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-minipass/node_modules/minipass": {
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
||||
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-minipass/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
@@ -7654,6 +7827,26 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/gauge": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz",
|
||||
"integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==",
|
||||
"deprecated": "This package is no longer supported.",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"aproba": "^1.0.3 || ^2.0.0",
|
||||
"color-support": "^1.1.3",
|
||||
"console-control-strings": "^1.1.0",
|
||||
"has-unicode": "^2.0.1",
|
||||
"signal-exit": "^3.0.7",
|
||||
"string-width": "^4.2.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"wide-align": "^1.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/gaze": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz",
|
||||
@@ -8108,6 +8301,12 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/hash.js": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
|
||||
@@ -9642,6 +9841,12 @@
|
||||
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lodash.isplainobject": {
|
||||
"version": "4.0.6",
|
||||
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
|
||||
"integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lodash.pickby": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.pickby/-/lodash.pickby-4.6.0.tgz",
|
||||
@@ -9849,6 +10054,29 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/memory-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/memory-stream/-/memory-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-Wm13VcsPIMdG96dzILfij09PvuS3APtcKNh7M28FsCA/w6+1mjR7hhPmfFNoilX9xU7wTdhsH5lJAm6XNzdtww==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"readable-stream": "^3.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/memory-stream/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/meow": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz",
|
||||
@@ -10041,6 +10269,37 @@
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/minizlib": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
|
||||
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minipass": "^3.0.0",
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/minizlib/node_modules/minipass": {
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
||||
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/minizlib/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/mitt": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz",
|
||||
@@ -10261,9 +10520,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-abi": {
|
||||
"version": "3.65.0",
|
||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.65.0.tgz",
|
||||
"integrity": "sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA==",
|
||||
"version": "3.71.0",
|
||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz",
|
||||
"integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"semver": "^7.3.5"
|
||||
@@ -10273,9 +10532,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-abi/node_modules/semver": {
|
||||
"version": "7.6.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
|
||||
"integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
|
||||
"version": "7.6.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
|
||||
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
@@ -10285,9 +10544,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz",
|
||||
"integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==",
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
|
||||
"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/node-api-headers": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/node-api-headers/-/node-api-headers-1.3.0.tgz",
|
||||
"integrity": "sha512-8Bviwtw4jNhv0B2qDjj4M5e6GyAuGtxsmZTrFJu3S3Z0+oHwIgSUdIKkKJmZd+EbMo7g3v4PLBbrjxwmZOqMBg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/node-domexception": {
|
||||
@@ -10435,6 +10700,22 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/npmlog": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz",
|
||||
"integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==",
|
||||
"deprecated": "This package is no longer supported.",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"are-we-there-yet": "^3.0.0",
|
||||
"console-control-strings": "^1.1.0",
|
||||
"gauge": "^4.0.3",
|
||||
"set-blocking": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nyc": {
|
||||
"version": "17.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nyc/-/nyc-17.0.0.tgz",
|
||||
@@ -13443,6 +13724,23 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/tar": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
|
||||
"integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"minipass": "^5.0.0",
|
||||
"minizlib": "^2.1.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/tar-fs": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
|
||||
@@ -13513,6 +13811,42 @@
|
||||
"safe-buffer": "^5.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/tar/node_modules/chownr": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
|
||||
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/tar/node_modules/minipass": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
|
||||
"integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/tar/node_modules/mkdirp": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"mkdirp": "bin/cmd.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/tar/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.31.1",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz",
|
||||
@@ -14173,6 +14507,12 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/url-join": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz",
|
||||
"integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/userhome": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.0.tgz",
|
||||
@@ -14802,6 +15142,15 @@
|
||||
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/wide-align": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
|
||||
"integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"string-width": "^1.0.2 || 2 || 3 || 4"
|
||||
}
|
||||
},
|
||||
"node_modules/workerpool": {
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz",
|
||||
@@ -15162,7 +15511,7 @@
|
||||
}
|
||||
},
|
||||
"packages/engine.io": {
|
||||
"version": "6.6.1",
|
||||
"version": "6.6.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/cookie": "^0.4.1",
|
||||
@@ -15170,7 +15519,7 @@
|
||||
"@types/node": ">=10.0.0",
|
||||
"accepts": "~1.3.4",
|
||||
"base64id": "2.0.0",
|
||||
"cookie": "~0.4.1",
|
||||
"cookie": "~0.7.2",
|
||||
"cors": "~2.8.5",
|
||||
"debug": "~4.3.1",
|
||||
"engine.io-parser": "~5.2.1",
|
||||
@@ -15223,7 +15572,7 @@
|
||||
}
|
||||
},
|
||||
"packages/socket.io": {
|
||||
"version": "4.7.5",
|
||||
"version": "4.8.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.4",
|
||||
@@ -15247,7 +15596,7 @@
|
||||
}
|
||||
},
|
||||
"packages/socket.io-client": {
|
||||
"version": "4.7.5",
|
||||
"version": "4.8.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
"@babel/plugin-transform-object-assign": "^7.24.7",
|
||||
"@babel/preset-env": "^7.24.7",
|
||||
"@babel/register": "^7.24.6",
|
||||
"@fails-components/webtransport": "^0.1.7",
|
||||
"@fails-components/webtransport": "^1.1.4",
|
||||
"@fails-components/webtransport-transport-http3-quiche": "^1.1.4",
|
||||
"@rollup/plugin-alias": "^5.1.0",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^26.0.1",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
| Version | Release date | Bundle size (UMD min+gzip) |
|
||||
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
|
||||
| [6.6.2](#662-2024-10-23) | October 2024 | `8.7 KB` |
|
||||
| [6.6.1](#661-2024-09-21) | September 2024 | `8.7 KB` |
|
||||
| [6.6.0](#660-2024-06-21) | June 2024 | `8.6 KB` |
|
||||
| [6.5.4](#654-2024-06-18) (from the [6.5.x](https://github.com/socketio/engine.io-client/tree/6.5.x) branch) | June 2024 | `8.8 KB` |
|
||||
@@ -39,6 +40,21 @@
|
||||
|
||||
# Release notes
|
||||
|
||||
## [6.6.2](https://github.com/socketio/socket.io/compare/engine.io-client@6.6.1...engine.io-client@6.6.2) (2024-10-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **types:** remove ws type from .d.ts file ([175a2c5](https://github.com/socketio/socket.io/commit/175a2c58c1bc37eb9b87f87df47e1f9388b01d55))
|
||||
* prevent infinite loop with Node.js built-in WebSocket ([4865f2e](https://github.com/socketio/socket.io/commit/4865f2e62eff9cf59f602e753d9f84159a3139af))
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) (no change)
|
||||
|
||||
|
||||
|
||||
## [6.6.1](https://github.com/socketio/socket.io/compare/engine.io-client@6.6.0...engine.io-client@6.6.1) (2024-09-21)
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
packages/engine.io-client/dist/engine.io.js
vendored
3
packages/engine.io-client/dist/engine.io.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Engine.IO v6.6.1
|
||||
* Engine.IO v6.6.2
|
||||
* (c) 2014-2024 Guillermo Rauch
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
@@ -2010,6 +2010,7 @@
|
||||
};
|
||||
_proto.doClose = function doClose() {
|
||||
if (typeof this.ws !== "undefined") {
|
||||
this.ws.onerror = function () {};
|
||||
this.ws.close();
|
||||
this.ws = null;
|
||||
}
|
||||
|
||||
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
@@ -15,7 +15,7 @@ export class WS extends BaseWS {
|
||||
uri: string,
|
||||
protocols: string | string[] | undefined,
|
||||
opts: Record<string, any>,
|
||||
) {
|
||||
): any {
|
||||
if (this.socket?._cookieJar) {
|
||||
opts.headers = opts.headers || {};
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ export abstract class BaseWS extends Transport {
|
||||
|
||||
override doClose() {
|
||||
if (typeof this.ws !== "undefined") {
|
||||
this.ws.onerror = () => {};
|
||||
this.ws.close();
|
||||
this.ws = null;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "engine.io-client",
|
||||
"description": "Client for the realtime Engine",
|
||||
"license": "MIT",
|
||||
"version": "6.6.1",
|
||||
"version": "6.6.2",
|
||||
"main": "./build/cjs/index.js",
|
||||
"module": "./build/esm/index.js",
|
||||
"exports": {
|
||||
@@ -63,6 +63,7 @@
|
||||
"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 --bail --require test/support/hooks.js test/index.js test/webtransport.mjs",
|
||||
"test:node-fetch": "USE_FETCH=1 npm run test:node",
|
||||
"test:node-builtin-ws": "USE_BUILTIN_WS=1 npm run test:node",
|
||||
"test:browser": "zuul test/index.js",
|
||||
"build": "rimraf ./dist && rollup -c support/rollup.config.umd.js && rollup -c support/rollup.config.esm.js",
|
||||
"bundle-size": "node support/bundle-size.js",
|
||||
|
||||
@@ -17,6 +17,19 @@ describe("connection", function () {
|
||||
});
|
||||
});
|
||||
|
||||
it("should connect to localhost (ws)", (done) => {
|
||||
const socket = new Socket({
|
||||
transports: ["websocket"],
|
||||
});
|
||||
socket.on("open", () => {
|
||||
socket.on("message", (data) => {
|
||||
expect(data).to.equal("hi");
|
||||
socket.close();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("should receive multibyte utf-8 strings with polling", (done) => {
|
||||
const socket = new Socket();
|
||||
socket.on("open", () => {
|
||||
|
||||
@@ -7,8 +7,6 @@ if (env.browser) {
|
||||
require("./node");
|
||||
}
|
||||
|
||||
const Blob = require("blob");
|
||||
|
||||
require("./engine.io-client");
|
||||
require("./socket");
|
||||
require("./transport");
|
||||
@@ -23,6 +21,6 @@ if (typeof ArrayBuffer !== "undefined") {
|
||||
}
|
||||
|
||||
// Blob is available in Node.js since v18, but not yet supported by the `engine.io-parser` package
|
||||
if (Blob && env.browser) {
|
||||
if (typeof Blob === "function" && env.browser) {
|
||||
require("./blob");
|
||||
}
|
||||
|
||||
@@ -35,3 +35,11 @@ if (exports.useFetch) {
|
||||
const { transports, Fetch } = require("../..");
|
||||
transports.polling = Fetch;
|
||||
}
|
||||
|
||||
exports.useBuiltinWs = process.env.USE_BUILTIN_WS !== undefined;
|
||||
|
||||
if (exports.useBuiltinWs) {
|
||||
console.warn("testing with built-in WebSocket object");
|
||||
const { transports, WebSocket } = require("../..");
|
||||
transports.websocket = WebSocket;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,10 @@ describe("Transport", () => {
|
||||
// these are server only
|
||||
if (!env.browser) {
|
||||
describe("options", () => {
|
||||
it("should accept an `agent` option for WebSockets", (done) => {
|
||||
it("should accept an `agent` option for WebSockets", function (done) {
|
||||
if (env.useBuiltinWs) {
|
||||
return this.skip();
|
||||
}
|
||||
const polling = new eio.transports.websocket({
|
||||
path: "/engine.io",
|
||||
hostname: "localhost",
|
||||
@@ -269,7 +272,10 @@ describe("Transport", () => {
|
||||
});
|
||||
|
||||
describe("perMessageDeflate", () => {
|
||||
it("should set threshold", (done) => {
|
||||
it("should set threshold", function (done) {
|
||||
if (env.useBuiltinWs) {
|
||||
return this.skip();
|
||||
}
|
||||
const socket = new eio.Socket({
|
||||
transports: ["websocket"],
|
||||
perMessageDeflate: { threshold: 0 },
|
||||
@@ -289,7 +295,10 @@ describe("Transport", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should not compress when the byte size is below threshold", (done) => {
|
||||
it("should not compress when the byte size is below threshold", function (done) {
|
||||
if (env.useBuiltinWs) {
|
||||
return this.skip();
|
||||
}
|
||||
const socket = new eio.Socket({ transports: ["websocket"] });
|
||||
socket.on("open", () => {
|
||||
const ws = socket.transport.ws;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Http3Server, WebTransport } from "@fails-components/webtransport";
|
||||
import { Http3EventLoop } from "@fails-components/webtransport/lib/event-loop.js";
|
||||
import expect from "expect.js";
|
||||
import { Server } from "engine.io";
|
||||
import { Socket } from "../build/esm-debug/index.js";
|
||||
@@ -16,7 +15,7 @@ async function setup(opts, cb) {
|
||||
const certificate = await generateWebTransportCertificate(
|
||||
[{ shortName: "CN", value: "localhost" }],
|
||||
{
|
||||
days: 14, // the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements)
|
||||
days: 13, // the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements)
|
||||
},
|
||||
);
|
||||
|
||||
@@ -48,7 +47,10 @@ async function setup(opts, cb) {
|
||||
})();
|
||||
|
||||
h3Server.startServer();
|
||||
h3Server.onServerListening = () => cb({ engine, h3Server, certificate });
|
||||
|
||||
await h3Server.ready;
|
||||
|
||||
cb({ engine, h3Server, certificate });
|
||||
}
|
||||
|
||||
function success(engine, h3server, done) {
|
||||
@@ -79,10 +81,6 @@ function createSocket(port, certificate, opts) {
|
||||
}
|
||||
|
||||
describe("WebTransport", () => {
|
||||
after(() => {
|
||||
Http3EventLoop.globalLoop.shutdownEventLoop(); // manually shutdown the event loop, instead of waiting 20s
|
||||
});
|
||||
|
||||
it("should allow to connect with WebTransport directly", (done) => {
|
||||
setup({}, ({ engine, h3Server, certificate }) => {
|
||||
const socket = createSocket(h3Server.port, certificate, {
|
||||
|
||||
@@ -51,7 +51,7 @@ const mapBinary = (data: RawData, binaryType?: BinaryType) => {
|
||||
);
|
||||
} else {
|
||||
// from WebTransport (Uint8Array)
|
||||
return data.buffer;
|
||||
return data.slice().buffer;
|
||||
}
|
||||
case "nodebuffer":
|
||||
default:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
| Version | Release date |
|
||||
|------------------------------------------------------------------------------------------------------|----------------|
|
||||
| [6.6.2](#662-2024-10-09) | October 2024 |
|
||||
| [6.6.1](#661-2024-09-21) | September 2024 |
|
||||
| [6.6.0](#660-2024-06-21) | June 2024 |
|
||||
| [6.5.5](#655-2024-06-18) (from the [6.5.x](https://github.com/socketio/engine.io/tree/6.5.x) branch) | June 2024 |
|
||||
@@ -46,6 +47,19 @@
|
||||
|
||||
# Release notes
|
||||
|
||||
## [6.6.2](https://github.com/socketio/socket.io/compare/engine.io@6.6.1...engine.io@6.6.2) (2024-10-09)
|
||||
|
||||
This release contains a bump of the `cookie` dependency.
|
||||
|
||||
See also: https://github.com/advisories/GHSA-pxg6-pf52-xh8x
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) (no change)
|
||||
|
||||
|
||||
|
||||
## [6.6.1](https://github.com/socketio/socket.io/compare/engine.io@6.6.0...engine.io@6.6.1) (2024-09-21)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "engine.io",
|
||||
"version": "6.6.1",
|
||||
"version": "6.6.2",
|
||||
"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",
|
||||
@@ -36,7 +36,7 @@
|
||||
"@types/node": ">=10.0.0",
|
||||
"accepts": "~1.3.4",
|
||||
"base64id": "2.0.0",
|
||||
"cookie": "~0.4.1",
|
||||
"cookie": "~0.7.2",
|
||||
"cors": "~2.8.5",
|
||||
"debug": "~4.3.1",
|
||||
"engine.io-parser": "~5.2.1",
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
if (process.env.EIO_CLIENT === "3" && process.versions.node.startsWith("22")) {
|
||||
// FIXME WebSocket error with engine.io-client@3
|
||||
global.WebSocket = null;
|
||||
}
|
||||
|
||||
const { listen, uServer } = require("..");
|
||||
const { Socket } =
|
||||
process.env.EIO_CLIENT === "3"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as eio from "../build/server.js";
|
||||
import { Http3Server, WebTransport } from "@fails-components/webtransport";
|
||||
import { Http3EventLoop } from "@fails-components/webtransport/lib/event-loop.js";
|
||||
import expect from "expect.js";
|
||||
import request from "superagent";
|
||||
import { createServer } from "http";
|
||||
@@ -30,7 +29,7 @@ async function setupServer(opts, cb) {
|
||||
const certificate = await generateWebTransportCertificate(
|
||||
[{ shortName: "CN", value: "localhost" }],
|
||||
{
|
||||
days: 14, // the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements)
|
||||
days: 13, // the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements)
|
||||
},
|
||||
);
|
||||
|
||||
@@ -62,7 +61,10 @@ async function setupServer(opts, cb) {
|
||||
})();
|
||||
|
||||
h3Server.startServer();
|
||||
h3Server.onServerListening = () => cb({ engine, h3Server, certificate });
|
||||
|
||||
await h3Server.ready;
|
||||
|
||||
cb({ engine, h3Server, certificate });
|
||||
}
|
||||
|
||||
function setup(opts, cb) {
|
||||
@@ -98,10 +100,6 @@ function setup(opts, cb) {
|
||||
}
|
||||
|
||||
describe("WebTransport", () => {
|
||||
after(() => {
|
||||
Http3EventLoop.globalLoop.shutdownEventLoop(); // manually shutdown the event loop, instead of waiting 20s
|
||||
});
|
||||
|
||||
it("should allow to connect with WebTransport directly", (done) => {
|
||||
setupServer({}, async ({ engine, h3Server, certificate }) => {
|
||||
const partialDone = createPartialDone(
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
| Version | Release date | Bundle size (UMD min+gzip) |
|
||||
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
|
||||
| [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` |
|
||||
| [4.7.4](#474-2024-01-12) | January 2024 | `14.5 KB` |
|
||||
@@ -51,7 +52,22 @@
|
||||
|
||||
# Release notes
|
||||
|
||||
# [4.8.0](https://github.com/socketio/socket.io/compare/socket.io-client@4.7.5...socket.io-client@4.8.0) (2024-09-21)
|
||||
## [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)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bundle:** do not mangle the "_placeholder" attribute ([ca9e994](https://github.com/socketio/socket.io/commit/ca9e994815aa2e31e0342e37ccdc2e9e8c5fd13c))
|
||||
|
||||
|
||||
### 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.0](https://github.com/socketio/socket.io/compare/socket.io-client@4.7.5...socket.io-client@4.8.0) (2024-09-21)
|
||||
|
||||
### Features
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
packages/socket.io-client/dist/socket.io.js
vendored
3
packages/socket.io-client/dist/socket.io.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Socket.IO v4.8.0
|
||||
* Socket.IO v4.8.1
|
||||
* (c) 2014-2024 Guillermo Rauch
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
@@ -1432,6 +1432,7 @@
|
||||
};
|
||||
_proto.doClose = function doClose() {
|
||||
if (typeof this.ws !== "undefined") {
|
||||
this.ws.onerror = function () {};
|
||||
this.ws.close();
|
||||
this.ws = null;
|
||||
}
|
||||
|
||||
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
@@ -99,3 +99,12 @@ export {
|
||||
lookup as connect,
|
||||
lookup as default,
|
||||
};
|
||||
|
||||
export {
|
||||
Fetch,
|
||||
NodeXHR,
|
||||
XHR,
|
||||
NodeWebSocket,
|
||||
WebSocket,
|
||||
WebTransport,
|
||||
} from "engine.io-client";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "socket.io-client",
|
||||
"version": "4.8.0",
|
||||
"version": "4.8.1",
|
||||
"description": "Realtime application framework client",
|
||||
"keywords": [
|
||||
"realtime",
|
||||
|
||||
@@ -52,6 +52,7 @@ const prodBundle = {
|
||||
mangle: {
|
||||
properties: {
|
||||
regex: /^_/,
|
||||
reserved: ["_placeholder"],
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -161,7 +161,7 @@ export class Namespace<
|
||||
SocketData
|
||||
>;
|
||||
|
||||
protected _fns: Array<
|
||||
private _fns: Array<
|
||||
(
|
||||
socket: Socket<ListenEvents, EmitEvents, ServerSideEvents, SocketData>,
|
||||
next: (err?: ExtendedError) => void,
|
||||
|
||||
@@ -67,7 +67,7 @@ export class ParentNamespace<
|
||||
): Namespace<ListenEvents, EmitEvents, ServerSideEvents, SocketData> {
|
||||
debug("creating child namespace %s", name);
|
||||
const namespace = new Namespace(this.server, name);
|
||||
this._fns.forEach((fn) => namespace.use(fn));
|
||||
this["_fns"].forEach((fn) => namespace.use(fn));
|
||||
this.listeners("connect").forEach((listener) =>
|
||||
namespace.on("connect", listener),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user