Compare commits

...

3 Commits
4.5.0 ... 4.5.1

9 changed files with 53 additions and 24 deletions

View File

@@ -1,3 +1,13 @@
## [4.5.1](https://github.com/socketio/socket.io/compare/4.5.0...4.5.1) (2022-05-17)
### Bug Fixes
* forward the local flag to the adapter when using fetchSockets() ([30430f0](https://github.com/socketio/socket.io/commit/30430f0985f8e7c49394543d4c84913b6a15df60))
* **typings:** add HTTPS server to accepted types ([#4351](https://github.com/socketio/socket.io/issues/4351)) ([9b43c91](https://github.com/socketio/socket.io/commit/9b43c9167cff817c60fa29dbda2ef7cd938aff51))
# [4.5.0](https://github.com/socketio/socket.io/compare/4.4.1...4.5.0) (2022-04-23)

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.5.0
* Socket.IO v4.5.1
* (c) 2014-2022 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.5.0
* Socket.IO v4.5.1
* (c) 2014-2022 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.5.0
* Socket.IO v4.5.1
* (c) 2014-2022 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.5.0
* Socket.IO v4.5.1
* (c) 2014-2022 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -262,6 +262,7 @@ export class BroadcastOperator<EmitEvents extends EventsMap, SocketData>
.fetchSockets({
rooms: this.rooms,
except: this.exceptRooms,
flags: this.flags,
})
.then((sockets) => {
return sockets.map((socket) => {
@@ -289,6 +290,7 @@ export class BroadcastOperator<EmitEvents extends EventsMap, SocketData>
{
rooms: this.rooms,
except: this.exceptRooms,
flags: this.flags,
},
Array.isArray(room) ? room : [room]
);
@@ -305,6 +307,7 @@ export class BroadcastOperator<EmitEvents extends EventsMap, SocketData>
{
rooms: this.rooms,
except: this.exceptRooms,
flags: this.flags,
},
Array.isArray(room) ? room : [room]
);
@@ -321,6 +324,7 @@ export class BroadcastOperator<EmitEvents extends EventsMap, SocketData>
{
rooms: this.rooms,
except: this.exceptRooms,
flags: this.flags,
},
close
);

View File

@@ -1,4 +1,5 @@
import http = require("http");
import type { Server as HTTPSServer } from "https";
import { createReadStream } from "fs";
import { createDeflate, createGzip, createBrotliCompress } from "zlib";
import accepts = require("accepts");
@@ -131,7 +132,7 @@ export class Server<
* @private
*/
_connectTimeout: number;
private httpServer: http.Server;
private httpServer: http.Server | HTTPSServer;
/**
* Server constructor.
@@ -141,13 +142,26 @@ export class Server<
* @public
*/
constructor(opts?: Partial<ServerOptions>);
constructor(srv?: http.Server | number, opts?: Partial<ServerOptions>);
constructor(
srv: undefined | Partial<ServerOptions> | http.Server | number,
srv?: http.Server | HTTPSServer | number,
opts?: Partial<ServerOptions>
);
constructor(
srv: undefined | Partial<ServerOptions> | http.Server | number,
srv:
| undefined
| Partial<ServerOptions>
| http.Server
| HTTPSServer
| number,
opts?: Partial<ServerOptions>
);
constructor(
srv:
| undefined
| Partial<ServerOptions>
| http.Server
| HTTPSServer
| number,
opts: Partial<ServerOptions> = {}
) {
super();
@@ -167,7 +181,8 @@ export class Server<
this.adapter(opts.adapter || Adapter);
this.sockets = this.of("/");
this.opts = opts;
if (srv || typeof srv == "number") this.attach(srv as http.Server | number);
if (srv || typeof srv == "number")
this.attach(srv as http.Server | HTTPSServer | number);
}
/**
@@ -300,7 +315,7 @@ export class Server<
* @public
*/
public listen(
srv: http.Server | number,
srv: http.Server | HTTPSServer | number,
opts: Partial<ServerOptions> = {}
): this {
return this.attach(srv, opts);
@@ -315,7 +330,7 @@ export class Server<
* @public
*/
public attach(
srv: http.Server | number,
srv: http.Server | HTTPSServer | number,
opts: Partial<ServerOptions> = {}
): this {
if ("function" == typeof srv) {
@@ -421,7 +436,7 @@ export class Server<
* @private
*/
private initEngine(
srv: http.Server,
srv: http.Server | HTTPSServer,
opts: EngineOptions & AttachOptions
): void {
// initialize engine
@@ -444,7 +459,7 @@ export class Server<
* @param srv http server
* @private
*/
private attachServe(srv: http.Server): void {
private attachServe(srv: http.Server | HTTPSServer): void {
debug("attaching client serving req handler");
const evs = srv.listeners("request").slice(0);

18
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "socket.io",
"version": "4.5.0",
"version": "4.5.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "socket.io",
"version": "4.5.0",
"version": "4.5.1",
"license": "MIT",
"dependencies": {
"accepts": "~1.3.4",
@@ -23,7 +23,7 @@
"nyc": "^15.1.0",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"socket.io-client": "4.5.0",
"socket.io-client": "4.5.1",
"socket.io-client-v2": "npm:socket.io-client@^2.4.0",
"superagent": "^6.1.0",
"supertest": "^6.1.6",
@@ -3117,9 +3117,9 @@
"integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg=="
},
"node_modules/socket.io-client": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.0.tgz",
"integrity": "sha512-HW61c1G7OrYGxaI79WRn17+b03iBCdvhBj4iqyXHBoL5M8w2MSO/vChsjA93knG4GYEai1/vbXWJna9dzxXtSg==",
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.1.tgz",
"integrity": "sha512-e6nLVgiRYatS+AHXnOnGi4ocOpubvOUCGhyWw8v+/FxW8saHkinG6Dfhi9TU0Kt/8mwJIAASxvw6eujQmjdZVA==",
"dev": true,
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
@@ -6246,9 +6246,9 @@
"integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg=="
},
"socket.io-client": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.0.tgz",
"integrity": "sha512-HW61c1G7OrYGxaI79WRn17+b03iBCdvhBj4iqyXHBoL5M8w2MSO/vChsjA93knG4GYEai1/vbXWJna9dzxXtSg==",
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.1.tgz",
"integrity": "sha512-e6nLVgiRYatS+AHXnOnGi4ocOpubvOUCGhyWw8v+/FxW8saHkinG6Dfhi9TU0Kt/8mwJIAASxvw6eujQmjdZVA==",
"dev": true,
"requires": {
"@socket.io/component-emitter": "~3.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io",
"version": "4.5.0",
"version": "4.5.1",
"description": "node.js realtime framework server",
"keywords": [
"realtime",
@@ -60,7 +60,7 @@
"nyc": "^15.1.0",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"socket.io-client": "4.5.0",
"socket.io-client": "4.5.1",
"socket.io-client-v2": "npm:socket.io-client@^2.4.0",
"superagent": "^6.1.0",
"supertest": "^6.1.6",