update buildRTSPURL to handle secure flag
This commit is contained in:
@@ -168,8 +168,13 @@ func buildRTSPURL(stream cameradar.Stream, route, username, password string) (*b
|
|||||||
host := net.JoinHostPort(stream.Address.String(), strconv.Itoa(int(stream.Port)))
|
host := net.JoinHostPort(stream.Address.String(), strconv.Itoa(int(stream.Port)))
|
||||||
path := "/" + strings.TrimLeft(strings.TrimSpace(route), "/") // Ensure path starts with a single "/"
|
path := "/" + strings.TrimLeft(strings.TrimSpace(route), "/") // Ensure path starts with a single "/"
|
||||||
|
|
||||||
|
scheme := "rtsp"
|
||||||
|
if stream.Secure {
|
||||||
|
scheme = "rtsps"
|
||||||
|
}
|
||||||
|
|
||||||
u := &url.URL{
|
u := &url.URL{
|
||||||
Scheme: "rtsp",
|
Scheme: scheme,
|
||||||
Host: host,
|
Host: host,
|
||||||
Path: path,
|
Path: path,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user