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

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

View File

@ -1,5 +1,11 @@
# Changelog
## 2025-02-21 - 3.9.2 - fix(PortProxy)
Improve timeout handling for port proxy connections
- Added console logging for both incoming and outgoing side timeouts in the PortProxy class.
- Updated the timeout event handlers to ensure proper cleanup of connections.
## 2025-02-21 - 3.9.1 - fix(dependencies)
Ensure correct ordering of dependencies and improve logging format.

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'));
};