rtmp: change default RTMPS port to 1936 when it is omitted in source (#2821)

This commit is contained in:
Alessandro Ros
2023-12-18 10:45:18 +01:00
committed by GitHub
parent 4e8b8a2014
commit fe4f436bd3
2 changed files with 9 additions and 5 deletions

View File

@@ -46,7 +46,11 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error {
// add default port
_, _, err = net.SplitHostPort(u.Host)
if err != nil {
u.Host = net.JoinHostPort(u.Host, "1935")
if u.Scheme == "rtmp" {
u.Host = net.JoinHostPort(u.Host, "1935")
} else {
u.Host = net.JoinHostPort(u.Host, "1936")
}
}
nconn, err := func() (net.Conn, error) {