From 2f0fad999a0c0a0476932c6d41347d4931780c64 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Fri, 29 Jul 2022 15:26:02 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/smartproxy.classes.networkproxy.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index a327e69..a549003 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.9', + version: '3.0.10', description: 'a proxy for handling high workloads of proxying' } diff --git a/ts/smartproxy.classes.networkproxy.ts b/ts/smartproxy.classes.networkproxy.ts index 74c8b74..270dff9 100644 --- a/ts/smartproxy.classes.networkproxy.ts +++ b/ts/smartproxy.classes.networkproxy.ts @@ -258,9 +258,11 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g= this.httpsServer.on('connection', (connection: plugins.net.Socket) => { connection.setTimeout(10000); this.socketMap.add(connection); + console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`); const cleanupConnection = () => { if (this.socketMap.checkForObject(connection)) { this.socketMap.remove(connection); + console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`); connection.end(() => { connection.destroy(); connection.removeAllListeners(); @@ -268,16 +270,16 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g= }); } }; - connection.addListener('close', () => { + connection.on('close', () => { cleanupConnection(); }); - connection.addListener('error', () => { + connection.on('error', () => { cleanupConnection(); }); - connection.addListener('end', () => { + connection.on('end', () => { cleanupConnection(); }); - connection.addListener('timeout', () => { + connection.on('timeout', () => { cleanupConnection(); }); });