diff --git a/src/server/wsServer.ts b/src/server/wsServer.ts index dee3acb5..62d12e7d 100644 --- a/src/server/wsServer.ts +++ b/src/server/wsServer.ts @@ -135,18 +135,10 @@ export class WSServer extends Disposable { const _handleWSError = (err: any): void => { if (err.code == 'EADDRINUSE') { this._connection.wsPort++; - this._wss = new WSServerWithOriginCheck({ - port: this._connection.wsPort, - host: this._connection.host, - path: this._connection.wsPath, - }); + this._startWSServer(basePath).then(resolve, reject); } else if (err.code == 'EADDRNOTAVAIL') { this._connection.resetHostToDefault(); - this._wss = new WSServerWithOriginCheck({ - port: this._connection.wsPort, - host: this._connection.host, - path: this._connection.wsPath, - }); + this._startWSServer(basePath).then(resolve, reject); } else { /* __GDPR__ "server.err" : {