Compare commits

...

6 Commits

Author SHA1 Message Date
1c47eafe5f 3.0.17 2022-07-30 17:32:59 +02:00
69e3a71354 fix(core): update 2022-07-30 17:32:58 +02:00
21e92bf0c1 3.0.16 2022-07-30 17:26:36 +02:00
d732e6e7aa fix(core): update 2022-07-30 17:26:35 +02:00
5fdfcdb407 3.0.15 2022-07-30 13:30:25 +02:00
49e2e90bda fix(core): update 2022-07-30 13:30:25 +02:00
5 changed files with 32 additions and 7 deletions

5
package-lock.json generated
View File

@ -1,15 +1,16 @@
{ {
"name": "@pushrocks/smartproxy", "name": "@pushrocks/smartproxy",
"version": "3.0.14", "version": "3.0.17",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smartproxy", "name": "@pushrocks/smartproxy",
"version": "3.0.14", "version": "3.0.17",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^6.0.0", "@pushrocks/lik": "^6.0.0",
"@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartpromise": "^3.1.7", "@pushrocks/smartpromise": "^3.1.7",
"@pushrocks/smartrequest": "^2.0.5", "@pushrocks/smartrequest": "^2.0.5",
"@pushrocks/smartstring": "^4.0.2", "@pushrocks/smartstring": "^4.0.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartproxy", "name": "@pushrocks/smartproxy",
"version": "3.0.14", "version": "3.0.17",
"private": false, "private": false,
"description": "a proxy for handling high workloads of proxying", "description": "a proxy for handling high workloads of proxying",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -22,6 +22,7 @@
}, },
"dependencies": { "dependencies": {
"@pushrocks/lik": "^6.0.0", "@pushrocks/lik": "^6.0.0",
"@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartpromise": "^3.1.7", "@pushrocks/smartpromise": "^3.1.7",
"@pushrocks/smartrequest": "^2.0.5", "@pushrocks/smartrequest": "^2.0.5",
"@pushrocks/smartstring": "^4.0.2", "@pushrocks/smartstring": "^4.0.2",

View File

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

View File

@ -209,6 +209,15 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
response.on('end', () => { response.on('end', () => {
res.end(); res.end();
}); });
response.on('error', () => {
res.end();
});
response.on('close', () => {
res.end();
});
response.on('timeout', () => {
res.end();
});
} }
); );
@ -257,15 +266,28 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
this.httpsServer.on('connection', (connection: plugins.net.Socket) => { this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
connection.setTimeout(10000); connection.setTimeout(10000);
let destroyed = false;
this.socketMap.add(connection); this.socketMap.add(connection);
console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`); console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`);
const destroyConnection = () => {
if (!destroyed) {
destroyed = true;
connection.destroy();
console.log(`socket successfully destroyed.`);
plugins.smartdelay.delayFor(1000).then(() => {
connection.removeAllListeners();
});
}
}
const cleanupConnection = () => { const cleanupConnection = () => {
if (this.socketMap.checkForObject(connection)) { if (this.socketMap.checkForObject(connection)) {
this.socketMap.remove(connection); this.socketMap.remove(connection);
plugins.smartdelay.delayFor(200).then(() => {
destroyConnection();
});
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`); console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
connection.end(() => { connection.end(() => {
connection.destroy(); destroyConnection();
console.log(`socket successfully destroyed`);
}); });
} }
}; };

View File

@ -13,11 +13,12 @@ export { tsclass };
// pushrocks scope // pushrocks scope
import * as lik from '@pushrocks/lik'; import * as lik from '@pushrocks/lik';
import * as smartdelay from '@pushrocks/smartdelay';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrequest from '@pushrocks/smartrequest'; import * as smartrequest from '@pushrocks/smartrequest';
import * as smartstring from '@pushrocks/smartstring'; import * as smartstring from '@pushrocks/smartstring';
export { lik, smartrequest, smartpromise, smartstring }; export { lik, smartdelay, smartrequest, smartpromise, smartstring };
// third party scope // third party scope
import * as ws from 'ws'; import * as ws from 'ws';