From a02b6cc8f141bc9e8f9a4f695d32930182624f2d Mon Sep 17 00:00:00 2001 From: Jarrad Whitaker Date: Sun, 26 Nov 2023 18:07:07 +1100 Subject: [PATCH] allow advertising services on port 0 --- server.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/server.go b/server.go index d895acd1..face6584 100644 --- a/server.go +++ b/server.go @@ -66,9 +66,6 @@ func Register(instance, service, domain string, port int, text []string, ifaces if entry.Domain == "" { entry.Domain = "local." } - if entry.Port == 0 { - return nil, fmt.Errorf("missing port") - } var err error if entry.HostName == "" { @@ -127,9 +124,6 @@ func RegisterProxy(instance, service, domain string, port int, host string, ips if entry.Domain == "" { entry.Domain = "local" } - if entry.Port == 0 { - return nil, fmt.Errorf("missing port") - } if !strings.HasSuffix(trimDot(entry.HostName), entry.Domain) { entry.HostName = fmt.Sprintf("%s.%s.", trimDot(entry.HostName), trimDot(entry.Domain))