Compare commits

...

4 Commits

Author SHA1 Message Date
f192a8f041 3.0.11 2022-07-29 16:12:18 +02:00
64bf3aef6d fix(core): update 2022-07-29 16:12:18 +02:00
a5e3cbd05b 3.0.10 2022-07-29 15:26:03 +02:00
2f0fad999a fix(core): update 2022-07-29 15:26:02 +02:00
4 changed files with 10 additions and 9 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@pushrocks/smartproxy",
"version": "3.0.9",
"version": "3.0.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartproxy",
"version": "3.0.9",
"version": "3.0.11",
"license": "MIT",
"dependencies": {
"@pushrocks/lik": "^6.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartproxy",
"version": "3.0.9",
"version": "3.0.11",
"private": false,
"description": "a proxy for handling high workloads of proxying",
"main": "dist_ts/index.js",

View File

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

View File

@ -258,26 +258,27 @@ 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();
console.log(`socket successfully destroyed`);
});
}
};
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();
});
});