Compare commits

..

4 Commits

Author SHA1 Message Date
Damien Arrachequesne
bfa6eab195 chore(release): engine.io-client@6.6.3
Diff: https://github.com/socketio/socket.io/compare/engine.io-client@6.6.2...engine.io-client@6.6.3
2025-01-23 07:38:37 +01:00
Ben McCann
7fcddcb3bb fix(engine.io-client): correctly consume the ws package (#5220)
This should fix the following issue:

```
SyntaxError: Named export 'WebSocket' not found. The requested module 'ws' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'ws';
const { WebSocket } = pkg;
```
2025-01-07 10:53:32 +01:00
Damien Arrachequesne
7427109658 refactor(eio): bump cookie to version 1.0.2
Release notes: https://github.com/jshttp/cookie/releases/tag/v1.0.0

The types are now included in the npm package. The `CookieSerializeOptions` type, which is used in our `ServerOptions` type, has been renamed to `SerializeOptions`, but there are no breaking change.

Related: https://github.com/socketio/socket.io/issues/5231
2024-11-21 08:57:37 +01:00
Damien Arrachequesne
91e1c8b358 chore(release): socket.io@4.8.1
Diff: https://github.com/socketio/socket.io/compare/socket.io@4.8.0...socket.io@4.8.1
2024-10-25 08:13:15 +02:00
20 changed files with 61 additions and 46 deletions

22
package-lock.json generated
View File

@@ -2823,11 +2823,6 @@
"@types/responselike": "^1.0.0"
}
},
"node_modules/@types/cookie": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q=="
},
"node_modules/@types/cors": {
"version": "2.8.17",
"resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz",
@@ -5761,11 +5756,11 @@
"dev": true
},
"node_modules/cookie": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
"integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
"engines": {
"node": ">= 0.6"
"node": ">=18"
}
},
"node_modules/cookie-signature": {
@@ -15514,12 +15509,11 @@
"version": "6.6.2",
"license": "MIT",
"dependencies": {
"@types/cookie": "^0.4.1",
"@types/cors": "^2.8.12",
"@types/node": ">=10.0.0",
"accepts": "~1.3.4",
"base64id": "2.0.0",
"cookie": "~0.7.2",
"cookie": "~1.0.2",
"cors": "~2.8.5",
"debug": "~4.3.1",
"engine.io-parser": "~5.2.1",
@@ -15530,7 +15524,7 @@
}
},
"packages/engine.io-client": {
"version": "6.6.1",
"version": "6.6.2",
"license": "MIT",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
@@ -15572,7 +15566,7 @@
}
},
"packages/socket.io": {
"version": "4.8.0",
"version": "4.8.1",
"license": "MIT",
"dependencies": {
"accepts": "~1.3.4",
@@ -15596,7 +15590,7 @@
}
},
"packages/socket.io-client": {
"version": "4.8.0",
"version": "4.8.1",
"license": "MIT",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",

View File

@@ -2,6 +2,7 @@
| Version | Release date | Bundle size (UMD min+gzip) |
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
| [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` |
| [6.6.0](#660-2024-06-21) | June 2024 | `8.6 KB` |
@@ -40,6 +41,20 @@
# Release notes
## [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)
### Bug Fixes
* correctly consume the `ws` package ([#5220](https://github.com/socketio/socket.io/issues/5220)) ([7fcddcb](https://github.com/socketio/socket.io/commit/7fcddcb3bbd236b46aa8fee6f4ce6c45afb7b03a))
### Dependencies
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) (no change)
## [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)

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
/*!
* Engine.IO v6.6.2
* (c) 2014-2024 Guillermo Rauch
* Engine.IO v6.6.3
* (c) 2014-2025 Guillermo Rauch
* Released under the MIT License.
*/
(function (global, factory) {

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
import { WebSocket } from "ws";
import * as ws from "ws";
import type { Packet, RawData } from "engine.io-parser";
import { BaseWS } from "./websocket.js";
@@ -27,7 +27,7 @@ export class WS extends BaseWS {
opts.headers.cookie.push(`${name}=${cookie.value}`);
}
}
return new WebSocket(uri, protocols, opts);
return new ws.WebSocket(uri, protocols, opts);
}
doWrite(packet: Packet, data: RawData) {

View File

@@ -2,7 +2,7 @@
"name": "engine.io-client",
"description": "Client for the realtime Engine",
"license": "MIT",
"version": "6.6.2",
"version": "6.6.3",
"main": "./build/cjs/index.js",
"module": "./build/esm/index.js",
"exports": {

View File

@@ -6,13 +6,13 @@ import { EventEmitter } from "events";
import { Socket } from "./socket";
import debugModule from "debug";
import { serialize } from "cookie";
import type { SerializeOptions } from "cookie";
import { Server as DEFAULT_WS_ENGINE } from "ws";
import type {
IncomingMessage,
Server as HttpServer,
ServerResponse,
} from "http";
import type { CookieSerializeOptions } from "cookie";
import type { CorsOptions, CorsOptionsDelegate } from "cors";
import type { Duplex } from "stream";
import { WebTransport } from "./transports/webtransport";
@@ -123,7 +123,7 @@ export interface ServerOptions {
* might be used for sticky-session. Defaults to not sending any cookie.
* @default false
*/
cookie?: (CookieSerializeOptions & { name: string }) | boolean;
cookie?: (SerializeOptions & { name: string }) | boolean;
/**
* the options that will be forwarded to the cors module
*/

View File

@@ -31,12 +31,11 @@
],
"license": "MIT",
"dependencies": {
"@types/cookie": "^0.4.1",
"@types/cors": "^2.8.12",
"@types/node": ">=10.0.0",
"accepts": "~1.3.4",
"base64id": "2.0.0",
"cookie": "~0.7.2",
"cookie": "~1.0.2",
"cors": "~2.8.5",
"debug": "~4.3.1",
"engine.io-parser": "~5.2.1",

View File

@@ -2,6 +2,7 @@
| Version | Release date |
|--------------------------------------------------------------------------------------------------|----------------|
| [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 |
| [4.7.4](#474-2024-01-12) | January 2024 |
@@ -50,6 +51,18 @@
# Release notes
## [4.8.1](https://github.com/socketio/socket.io/compare/socket.io@4.8.0...socket.io@4.8.1) (2024-10-25)
Due to a change in the bundler configuration, the production bundle (`socket.io.min.js`) did not support sending and receiving binary data in version `4.8.0`. This is now fixed.
### Dependencies
- [`engine.io@~6.6.0`](https://github.com/socketio/engine.io/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@4.7.5...socket.io@4.8.0) (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

View File

@@ -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

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io",
"version": "4.8.0",
"version": "4.8.1",
"description": "node.js realtime framework server",
"keywords": [
"realtime",

View File

@@ -1,13 +1,6 @@
"use strict";
import expect from "expect.js";
describe("socket.io", () => {
it("should be the same version as client", () => {
const version = require("../package").version;
expect(version).to.be(require("socket.io-client/package.json").version);
});
require("./server-attachment");
require("./handshake");
require("./close");