fix(core): update
This commit is contained in:
parent
b8e53e7b42
commit
49e2e90bda
1
package-lock.json
generated
1
package-lock.json
generated
@ -10,6 +10,7 @@
|
|||||||
"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",
|
||||||
|
@ -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",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartproxy',
|
name: '@pushrocks/smartproxy',
|
||||||
version: '3.0.14',
|
version: '3.0.15',
|
||||||
description: 'a proxy for handling high workloads of proxying'
|
description: 'a proxy for handling high workloads of proxying'
|
||||||
}
|
}
|
||||||
|
@ -257,15 +257,25 @@ 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.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
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`);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -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';
|
||||||
|
Loading…
Reference in New Issue
Block a user