@nestjs/websockets
Advanced tools
Comparing version 10.4.8 to 10.4.9
@@ -10,2 +10,4 @@ import { INestApplicationContext, WebSocketAdapter } from '@nestjs/common'; | ||
protected readonly httpServer: any; | ||
private _forceCloseConnections; | ||
set forceCloseConnections(value: boolean); | ||
constructor(appOrHttpServer?: INestApplicationContext | any); | ||
@@ -12,0 +14,0 @@ bindClientConnect(server: TServer, callback: Function): void; |
@@ -8,2 +8,5 @@ "use strict"; | ||
class AbstractWsAdapter { | ||
set forceCloseConnections(value) { | ||
this._forceCloseConnections = value; | ||
} | ||
constructor(appOrHttpServer) { | ||
@@ -24,2 +27,5 @@ if (appOrHttpServer && appOrHttpServer instanceof core_1.NestApplication) { | ||
async close(server) { | ||
if (this._forceCloseConnections) { | ||
return; | ||
} | ||
const isCallable = server && (0, shared_utils_1.isFunction)(server.close); | ||
@@ -26,0 +32,0 @@ isCallable && (await new Promise(resolve => server.close(resolve))); |
{ | ||
"name": "@nestjs/websockets", | ||
"version": "10.4.8", | ||
"version": "10.4.9", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)", | ||
@@ -21,4 +21,4 @@ "author": "Kamil Mysliwiec", | ||
"devDependencies": { | ||
"@nestjs/common": "10.4.8", | ||
"@nestjs/core": "10.4.8" | ||
"@nestjs/common": "10.4.9", | ||
"@nestjs/core": "10.4.9" | ||
}, | ||
@@ -25,0 +25,0 @@ "peerDependencies": { |
@@ -65,4 +65,8 @@ "use strict"; | ||
initializeAdapter() { | ||
const forceCloseConnections = this.appOptions | ||
.forceCloseConnections; | ||
const adapter = this.applicationConfig.getIoAdapter(); | ||
if (adapter) { | ||
adapter.forceCloseConnections = | ||
forceCloseConnections; | ||
this.isAdapterInitialized = true; | ||
@@ -73,2 +77,3 @@ return; | ||
const ioAdapter = new IoAdapter(this.httpServer); | ||
ioAdapter.forceCloseConnections = forceCloseConnections; | ||
this.applicationConfig.setIoAdapter(ioAdapter); | ||
@@ -75,0 +80,0 @@ this.isAdapterInitialized = true; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80621
1463
12
15
2
31