From d4b7ae808fef932384d1840434a91b97ee3feecd Mon Sep 17 00:00:00 2001 From: yusing Date: Fri, 9 Jan 2026 10:09:59 +0800 Subject: [PATCH] fix(route): allow hostname for stream routes; introduced in 3643add8a3f9c6d897abec5b2a20d7f770c9439e --- internal/route/route.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/route/route.go b/internal/route/route.go index f08383e5..77bc20b3 100644 --- a/internal/route/route.go +++ b/internal/route/route.go @@ -286,14 +286,11 @@ func (r *Route) validate() gperr.Error { r.Bind = "0.0.0.0" } bindIP := net.ParseIP(r.Bind) - if bindIP == nil { - return gperr.Errorf("invalid bind address %s", r.Bind) - } remoteIP := net.ParseIP(r.Host) - if remoteIP == nil { - return gperr.Errorf("invalid remote address %s", r.Host) - } toNetwork := func(ip net.IP, scheme route.Scheme) string { + if ip == nil { // hostname, indeterminate + return scheme.String() + } if ip.To4() == nil { if scheme == route.SchemeTCP { return "tcp6"