@tsed/socketio 8.46.3 → 8.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,10 +22,10 @@ export class SocketIOModule {
22
22
  }
23
23
  $afterListen() {
24
24
  if (this.httpServer) {
25
- this.io.attach(this.httpServer, { ...this.settings });
25
+ this.attach(this.httpServer);
26
26
  }
27
27
  if (this.httpsServer) {
28
- this.io.attach(this.httpsServer, { ...this.settings });
28
+ this.attach(this.httpsServer);
29
29
  }
30
30
  this.getWebsocketServices().forEach((provider) => this.socketIOService.addSocketProvider(provider));
31
31
  if (!this.disableRoutesSummary) {
@@ -36,6 +36,18 @@ export class SocketIOModule {
36
36
  $onDestroy() {
37
37
  return this.io?.close && this.io?.engine && new Promise((resolve) => this.io.close(() => resolve(undefined)));
38
38
  }
39
+ /**
40
+ * A server on uWebSockets.js, as with PlatformFulmine, has no Node.js socket to take the upgrade from: socket.io
41
+ * attaches to its uWebSockets.js app instead.
42
+ */
43
+ attach(server) {
44
+ if ("uwsApp" in server) {
45
+ this.io.attachApp(server.uwsApp, { ...this.settings });
46
+ }
47
+ else {
48
+ this.io.attach(server, { ...this.settings });
49
+ }
50
+ }
39
51
  /**
40
52
  *
41
53
  * @returns {Provider<any>[]}
@@ -15,6 +15,11 @@ export declare class SocketIOModule implements AfterListen, OnDestroy {
15
15
  private io;
16
16
  $afterListen(): Promise<void>;
17
17
  $onDestroy(): Promise<unknown>;
18
+ /**
19
+ * A server on uWebSockets.js, as with PlatformFulmine, has no Node.js socket to take the upgrade from: socket.io
20
+ * attaches to its uWebSockets.js app instead.
21
+ */
22
+ protected attach(server: any): void;
18
23
  /**
19
24
  *
20
25
  * @returns {Provider<any>[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/socketio",
3
- "version": "8.46.3",
3
+ "version": "8.47.1",
4
4
  "description": "Socket.io package for Ts.ED framework",
5
5
  "keywords": [
6
6
  "realtime",
@@ -34,16 +34,16 @@
34
34
  "tslib": ">=2.7.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@tsed/barrels": "8.46.3",
38
- "@tsed/core": "8.46.3",
39
- "@tsed/di": "8.46.3",
40
- "@tsed/json-mapper": "8.46.3",
41
- "@tsed/openspec": "8.46.3",
42
- "@tsed/platform-http": "8.46.3",
43
- "@tsed/platform-middlewares": "8.46.3",
44
- "@tsed/schema": "8.46.3",
45
- "@tsed/socketio-testing": "8.46.3",
46
- "@tsed/typescript": "8.46.3",
37
+ "@tsed/barrels": "8.47.1",
38
+ "@tsed/core": "8.47.1",
39
+ "@tsed/di": "8.47.1",
40
+ "@tsed/json-mapper": "8.47.1",
41
+ "@tsed/openspec": "8.47.1",
42
+ "@tsed/platform-http": "8.47.1",
43
+ "@tsed/platform-middlewares": "8.47.1",
44
+ "@tsed/schema": "8.47.1",
45
+ "@tsed/socketio-testing": "8.47.1",
46
+ "@tsed/typescript": "8.47.1",
47
47
  "express": "5.2.1",
48
48
  "socket.io": "4.8.0",
49
49
  "socket.io-client": "^4.8.0",