1
0
Fork 0
forked from External/mediamtx

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) {