From a7a922308e467ee41b3acca09255c1436c2bafa7 Mon Sep 17 00:00:00 2001 From: yusing Date: Wed, 2 Oct 2024 14:01:36 +0800 Subject: [PATCH] fixed streams with zero port being served --- internal/proxy/fields/port.go | 9 ++++----- internal/route/stream.go | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/proxy/fields/port.go b/internal/proxy/fields/port.go index a0e34ce..9d517e3 100644 --- a/internal/proxy/fields/port.go +++ b/internal/proxy/fields/port.go @@ -33,9 +33,8 @@ func (p Port) String() string { } const ( - MinPort = 0 - MaxPort = 65535 - ErrPort = Port(-1) - NoPort = Port(-1) - ZeroPort = Port(0) + MinPort = 0 + MaxPort = 65535 + ErrPort = Port(-1) + NoPort = Port(0) ) diff --git a/internal/route/stream.go b/internal/route/stream.go index 1cef5ec..cedd67b 100755 --- a/internal/route/stream.go +++ b/internal/route/stream.go @@ -58,7 +58,7 @@ func (r *StreamRoute) String() string { } func (r *StreamRoute) Start() E.NestedError { - if r.Port.ListeningPort == PT.NoPort || r.started.Load() { + if r.Port.ProxyPort == PT.NoPort || r.started.Load() { return nil } r.ctx, r.cancel = context.WithCancel(context.Background())