Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
f192a8f041 | |||
64bf3aef6d | |||
a5e3cbd05b | |||
2f0fad999a |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.9",
|
"version": "3.0.11",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.9",
|
"version": "3.0.11",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^6.0.0",
|
"@pushrocks/lik": "^6.0.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.9",
|
"version": "3.0.11",
|
||||||
"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",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartproxy',
|
name: '@pushrocks/smartproxy',
|
||||||
version: '3.0.9',
|
version: '3.0.11',
|
||||||
description: 'a proxy for handling high workloads of proxying'
|
description: 'a proxy for handling high workloads of proxying'
|
||||||
}
|
}
|
||||||
|
@ -258,26 +258,27 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
|||||||
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
|
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
|
||||||
connection.setTimeout(10000);
|
connection.setTimeout(10000);
|
||||||
this.socketMap.add(connection);
|
this.socketMap.add(connection);
|
||||||
|
console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`);
|
||||||
const cleanupConnection = () => {
|
const cleanupConnection = () => {
|
||||||
if (this.socketMap.checkForObject(connection)) {
|
if (this.socketMap.checkForObject(connection)) {
|
||||||
this.socketMap.remove(connection);
|
this.socketMap.remove(connection);
|
||||||
|
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
|
||||||
connection.end(() => {
|
connection.end(() => {
|
||||||
connection.destroy();
|
connection.destroy();
|
||||||
connection.removeAllListeners();
|
|
||||||
console.log(`socket successfully destroyed`);
|
console.log(`socket successfully destroyed`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
connection.addListener('close', () => {
|
connection.on('close', () => {
|
||||||
cleanupConnection();
|
cleanupConnection();
|
||||||
});
|
});
|
||||||
connection.addListener('error', () => {
|
connection.on('error', () => {
|
||||||
cleanupConnection();
|
cleanupConnection();
|
||||||
});
|
});
|
||||||
connection.addListener('end', () => {
|
connection.on('end', () => {
|
||||||
cleanupConnection();
|
cleanupConnection();
|
||||||
});
|
});
|
||||||
connection.addListener('timeout', () => {
|
connection.on('timeout', () => {
|
||||||
cleanupConnection();
|
cleanupConnection();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user