Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
cc38a6d10e | |||
748b07efe2 | |||
be4fd0978a | |||
4521010b82 | |||
bd1f1a4c1c | |||
d3bdd56660 | |||
c38a7c4c32 | |||
858628196a | |||
4910679058 | |||
97db2012ca | |||
0ee13b4e06 | |||
21f5882fa3 | |||
48b43f9f0d | |||
d3d476fd53 | |||
b80b8a0a20 | |||
384943f697 | |||
e9239ed978 | |||
baf1844866 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.23",
|
"version": "3.0.32",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.23",
|
"version": "3.0.32",
|
||||||
"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.23",
|
"version": "3.0.32",
|
||||||
"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.23',
|
version: '3.0.32',
|
||||||
description: 'a proxy for handling high workloads of proxying'
|
description: 'a proxy for handling high workloads of proxying'
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,7 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
|||||||
) => {
|
) => {
|
||||||
res.writeHead(statusArg, messageArg);
|
res.writeHead(statusArg, messageArg);
|
||||||
res.end(messageArg);
|
res.end(messageArg);
|
||||||
|
res.destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(`got request: ${req.headers.host}${plugins.url.parse(req.url).path}`);
|
console.log(`got request: ${req.headers.host}${plugins.url.parse(req.url).path}`);
|
||||||
@ -200,8 +201,8 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
|||||||
request.end();
|
request.end();
|
||||||
});
|
});
|
||||||
req.on('timeout', () => {
|
req.on('timeout', () => {
|
||||||
|
req.destroy();
|
||||||
request.end();
|
request.end();
|
||||||
request.destroy();
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -227,8 +228,9 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
|||||||
});
|
});
|
||||||
response.on('timeout', () => {
|
response.on('timeout', () => {
|
||||||
res.end();
|
res.end();
|
||||||
res.destroy();
|
res.destroy()
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -260,9 +262,7 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
|||||||
// handle closing
|
// handle closing
|
||||||
const cleanUp = () => {
|
const cleanUp = () => {
|
||||||
ws.close();
|
ws.close();
|
||||||
ws.terminate();
|
|
||||||
wsc.close();
|
wsc.close();
|
||||||
wsc.terminate();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ws.on('close', (message) => {
|
ws.on('close', (message) => {
|
||||||
@ -273,25 +273,18 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
|||||||
cleanUp();
|
cleanUp();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
this.httpsServer.keepAliveTimeout = 61000;
|
this.httpsServer.keepAliveTimeout = 61000;
|
||||||
this.httpsServer.headersTimeout = 65000;
|
this.httpsServer.headersTimeout = 65000;
|
||||||
|
|
||||||
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
|
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
|
||||||
connection.setTimeout(60000);
|
|
||||||
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 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.`);
|
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
|
||||||
connection.end();
|
|
||||||
connection.destroy();
|
connection.destroy();
|
||||||
console.log(`socket successfully destroyed.`);
|
|
||||||
/* plugins.smartdelay.delayFor(10000).then(() => {
|
|
||||||
connection.removeAllListeners();
|
|
||||||
}) */
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
connection.on('close', () => {
|
connection.on('close', () => {
|
||||||
@ -305,7 +298,7 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
|||||||
});
|
});
|
||||||
connection.on('timeout', () => {
|
connection.on('timeout', () => {
|
||||||
cleanupConnection();
|
cleanupConnection();
|
||||||
});
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
this.httpsServer.listen(this.options.port);
|
this.httpsServer.listen(this.options.port);
|
||||||
|
Reference in New Issue
Block a user