fix(route): allow excluded routes to use localhost addresses

Routes marked for exclusion should bypass normal validation checks,
including the restriction on localhost/127.0.0.1 hostnames.
This commit is contained in:
yusing
2026-01-31 18:51:15 +08:00
parent 5c30f4a859
commit 4c62a4b365

View File

@@ -254,7 +254,7 @@ func (r *Route) validate() gperr.Error {
}
// return error if route is localhost:<godoxy_port> but route is not agent
if !r.IsAgent() {
if !r.IsAgent() && !r.ShouldExclude() {
switch r.Host {
case "localhost", "127.0.0.1":
switch r.Port.Proxy {