fix(proxy): improve connection cleanup and route validation handling

This commit is contained in:
2026-03-25 07:22:17 +00:00
parent 34dc0cb9b6
commit 53dee1fffc
12 changed files with 689 additions and 623 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartproxy',
version: '26.2.1',
version: '26.2.2',
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.'
}

View File

@@ -69,14 +69,15 @@ export function createOffsetPortMappingRoute(options: {
priority?: number;
[key: string]: any;
}): IRouteConfig {
const { ports, targetHost, offset, name, domains, priority, ...rest } = options;
return createPortMappingRoute({
sourcePortRange: options.ports,
targetHost: options.targetHost,
portMapper: (context) => context.port + options.offset,
name: options.name || `Offset Mapping (${options.offset > 0 ? '+' : ''}${options.offset}) for ${options.domains || 'all domains'}`,
domains: options.domains,
priority: options.priority,
...options
sourcePortRange: ports,
targetHost,
portMapper: (context) => context.port + offset,
name: name || `Offset Mapping (${offset > 0 ? '+' : ''}${offset}) for ${domains || 'all domains'}`,
domains,
priority,
...rest
});
}

View File

@@ -258,7 +258,9 @@ export class RouteValidator {
errorMap.set(route.name, existingErrors);
valid = false;
}
routeNames.add(route.name);
if (route.name) {
routeNames.add(route.name);
}
}
// Validate each route
@@ -328,7 +330,7 @@ export class RouteValidator {
if (catchAllRoutes.length > 1) {
for (const route of catchAllRoutes) {
conflicts.push({
route: route.name,
route: route.name || 'unnamed',
message: `Multiple catch-all routes on port ${port}`
});
}