Compare commits

...

6 Commits

Author SHA1 Message Date
da19fab8d8 2.0.12 2021-02-03 11:02:26 +00:00
8d318dca28 fix(core): update 2021-02-03 11:02:26 +00:00
d03bfcc793 2.0.11 2021-02-03 01:14:10 +00:00
4ba2686977 fix(core): update 2021-02-03 01:14:09 +00:00
d24c4d4b7a 2.0.10 2021-02-03 00:30:35 +00:00
e1d4d6cf38 fix(core): update 2021-02-03 00:30:35 +00:00
4 changed files with 22 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartproxy",
"version": "2.0.9",
"version": "2.0.12",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

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

View File

@ -162,6 +162,7 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
{
method: req.method,
headers: req.headers,
keepAlive: true
},
true, // lets make this streaming
(request) => {
@ -224,10 +225,24 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
this.httpsServer.keepAliveTimeout = 61000;
this.httpsServer.headersTimeout = 65000;
this.httpsServer.on('connection', (connection) => {
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
connection.setTimeout(120000);
this.socketMap.add(connection);
connection.on('close', () => {
this.socketMap.remove(connection);
connection.destroy();
});
connection.on('error', () => {
this.socketMap.remove(connection);
connection.destroy();
});
connection.on('end', () => {
this.socketMap.remove(connection);
connection.destroy();
});
connection.on('timeout', () => {
this.socketMap.remove(connection);
connection.destroy();
});
});

View File

@ -45,6 +45,10 @@ export class SmartProxy {
console.log('successfully spawned portproxy and proxyworkers!');
}
public async updateDefaultHeaders(defaultHeadersArg: {[key: string]: string}) {
await this.proxyWorkerFunctions.addDefaultHeaders(defaultHeadersArg);
}
public async stop() {
await this.proxyWorkerFunctions.stop();
await plugins.smartspawn.Thread.terminate(this.proxyWorkerFunctions);