fix(core): update

This commit is contained in:
Philipp Kunz 2023-01-06 13:04:11 +01:00
parent ee4f7fc48d
commit 0739d1093a
2 changed files with 14 additions and 5 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartproxy',
version: '3.0.56',
version: '3.0.57',
description: 'a proxy for handling high workloads of proxying'
}

View File

@ -268,10 +268,19 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
// console.log("upstream to client", message);
wsIncoming.send(message, { binary: isBinary });
});
wsIncoming.on("error", () => wsOutgoing.terminate());
wsOutgoing.on("error", () => wsIncoming.terminate());
wsIncoming.on("close", () => wsOutgoing.terminate());
wsOutgoing.on("close", () => wsIncoming.terminate());
const terminateWsOutgoing = () => {
wsOutgoing.terminate();
console.log('terminated outgoing ws.');
}
wsIncoming.on("error", () => terminateWsOutgoing());
wsIncoming.on("close", () => terminateWsOutgoing());
const terminateWsIncoming = () => {
wsIncoming.terminate();
console.log('terminated incoming ws.');
}
wsOutgoing.on("error", () => terminateWsIncoming());
wsOutgoing.on("close", () => terminateWsIncoming());
});
this.httpsServer.keepAliveTimeout = 600 * 1000;