From 8ce89bec75c20e79454ee1817c2b323e2248dc38 Mon Sep 17 00:00:00 2001 From: eduard256 Date: Wed, 1 Apr 2026 17:53:00 +0000 Subject: [PATCH] Always include port in URL for protocols with raw TCP dial Bubble protocol uses net.DialTimeout with u.Host directly, which requires explicit port. Add portRequired set to force port in generated URLs for such protocols. --- pkg/camdb/streams.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/camdb/streams.go b/pkg/camdb/streams.go index c53150a..2404e8b 100644 --- a/pkg/camdb/streams.go +++ b/pkg/camdb/streams.go @@ -14,6 +14,11 @@ var defaultPorts = map[string]int{ "rtmp": 1935, "mms": 554, "rtp": 5004, "bubble": 80, } +// protocols where port must always be explicit in URL (raw TCP dial without default port logic) +var portRequired = map[string]bool{ + "bubble": true, +} + type StreamParams struct { IDs string IP string @@ -137,7 +142,7 @@ func buildURL(protocol, path, ip string, port int, user, pass string, channel in } host := ip - if p, ok := defaultPorts[protocol]; !ok || p != port { + if p, ok := defaultPorts[protocol]; (!ok || p != port) || portRequired[protocol] { host = ip + ":" + strconv.Itoa(port) }