diff --git a/internal/health/check/stream.go b/internal/health/check/stream.go index 6f4c9a16..8ccfa915 100644 --- a/internal/health/check/stream.go +++ b/internal/health/check/stream.go @@ -12,6 +12,14 @@ import ( ) func Stream(ctx context.Context, url *url.URL, timeout time.Duration) (types.HealthCheckResult, error) { + if port := url.Port(); port == "" || port == "0" { + return types.HealthCheckResult{ + Latency: 0, + Healthy: false, + Detail: "no port specified", + }, nil + } + dialer := net.Dialer{ Timeout: timeout, FallbackDelay: -1,