fix(smartproxy): Improve error handling in forwarding connection handler and refine domain matching logic

This commit is contained in:
2025-05-19 18:29:56 +00:00
parent 98ef91b6ea
commit 3bf4e97e71
7 changed files with 303 additions and 280 deletions

View File

@ -338,10 +338,19 @@ export class RouteManager extends plugins.EventEmitter {
// Find the first matching route based on priority order
for (const route of routesForPort) {
// Check domain match if specified
if (domain && !this.matchRouteDomain(route, domain)) {
continue;
// Check domain match
// If the route has domain restrictions and we have a domain to check
if (route.match.domains) {
// If no domain was provided (non-TLS or no SNI), this route doesn't match
if (!domain) {
continue;
}
// If domain is provided but doesn't match the route's domains, skip
if (!this.matchRouteDomain(route, domain)) {
continue;
}
}
// If route has no domain restrictions, it matches all domains
// Check path match if specified in both route and request
if (path && route.match.path) {