From 8087bab197cb0a40f00636ee703364c415f24ed7 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 5 Jan 2023 18:05:36 +0100 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/smartproxy.classes.networkproxy.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 1681d71..e5970c3 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@pushrocks/smartproxy', - version: '3.0.47', + version: '3.0.48', description: 'a proxy for handling high workloads of proxying' } diff --git a/ts/smartproxy.classes.networkproxy.ts b/ts/smartproxy.classes.networkproxy.ts index b6fa64b..675552d 100644 --- a/ts/smartproxy.classes.networkproxy.ts +++ b/ts/smartproxy.classes.networkproxy.ts @@ -253,7 +253,14 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g= ws.on('message', async (message) => { if (!wscConnectedDeferred) { wscConnectedDeferred = plugins.smartpromise.defer(); - const wsc = new plugins.wsDefault(`wss://${this.router.routeReq(reqArg).destinationIp}:${this.router.routeReq(reqArg).destinationPort}${reqArg.url}`); + let wsc; + try { + wsc = new plugins.wsDefault(`wss://${this.router.routeReq(reqArg).destinationIp}:${this.router.routeReq(reqArg).destinationPort}${reqArg.url}`); + } catch (err) { + console.log(err); + ws.terminate(); + return; + } wsc.on('open', () => { wscConnectedDeferred.resolve(wsc);