Compare commits

..

2 Commits

Author SHA1 Message Date
311691c2cc 19.5.22
Some checks failed
Default (tags) / security (push) Successful in 36s
Default (tags) / test (push) Failing after 19m29s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-06-06 15:54:40 +00:00
578d1ba2f7 update 2025-06-06 15:00:46 +00:00
2 changed files with 20 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/smartproxy", "name": "@push.rocks/smartproxy",
"version": "19.5.21", "version": "19.5.22",
"private": false, "private": false,
"description": "A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.", "description": "A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -199,9 +199,8 @@ export class RouteConnectionHandler {
setupSocketHandlers( setupSocketHandlers(
underlyingSocket, underlyingSocket,
(reason) => { (reason) => {
// Only cleanup if connection hasn't been fully established // Always cleanup when incoming socket closes
// Check if outgoing connection exists and is connected // This prevents connection accumulation in proxy chains
if (!record.outgoing || record.outgoing.readyState !== 'open') {
logger.log('debug', `Connection ${connectionId} closed during immediate routing: ${reason}`, { logger.log('debug', `Connection ${connectionId} closed during immediate routing: ${reason}`, {
connectionId, connectionId,
remoteIP: record.remoteIP, remoteIP: record.remoteIP,
@ -211,13 +210,18 @@ export class RouteConnectionHandler {
component: 'route-handler' component: 'route-handler'
}); });
// If there's a pending outgoing connection, destroy it // If there's a pending or established outgoing connection, destroy it
if (record.outgoing && !record.outgoing.destroyed) { if (record.outgoing && !record.outgoing.destroyed) {
logger.log('debug', `Destroying outgoing connection for ${connectionId}`, {
connectionId,
outgoingState: record.outgoing.readyState,
component: 'route-handler'
});
record.outgoing.destroy(); record.outgoing.destroy();
} }
// Always cleanup the connection record
this.connectionManager.cleanupConnection(record, reason); this.connectionManager.cleanupConnection(record, reason);
}
}, },
undefined, // Use default timeout handler undefined, // Use default timeout handler
'immediate-route-client' 'immediate-route-client'