fix(PortProxy): Improve timeout handling for port proxy connections

This commit is contained in:
2025-02-21 23:33:15 +00:00
parent 59625167b4
commit 942e0649c8
3 changed files with 15 additions and 3 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartproxy',
version: '3.9.1',
version: '3.9.2',
description: 'a proxy for handling high workloads of proxying'
}

View File

@ -279,8 +279,14 @@ export class PortProxy {
to.on('error', handleError('outgoing'));
socket.on('close', handleClose('incoming'));
to.on('close', handleClose('outgoing'));
socket.on('timeout', handleError('incoming'));
to.on('timeout', handleError('outgoing'));
socket.on('timeout', () => {
console.log(`Timeout on incoming side from ${remoteIP}`);
cleanupOnce();
});
to.on('timeout', () => {
console.log(`Timeout on outgoing side from ${remoteIP}`);
cleanupOnce();
});
socket.on('end', handleClose('incoming'));
to.on('end', handleClose('outgoing'));
};