mirror of
https://github.com/aler9/gortsplib
synced 2025-09-28 20:12:18 +08:00
client: fix RTSPS default port
This commit is contained in:
10
client.go
10
client.go
@@ -977,8 +977,14 @@ func (c *Client) connOpen() error {
|
|||||||
return fmt.Errorf("RTSPS can be used only with TCP")
|
return fmt.Errorf("RTSPS can be used only with TCP")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(c.host, ":") {
|
// add default port
|
||||||
c.host += ":554"
|
_, _, err := net.SplitHostPort(c.host)
|
||||||
|
if err != nil {
|
||||||
|
if c.scheme == "rtsp" {
|
||||||
|
c.host = net.JoinHostPort(c.host, "554")
|
||||||
|
} else { // rtsps
|
||||||
|
c.host = net.JoinHostPort(c.host, "8322")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(c.ctx, c.ReadTimeout)
|
ctx, cancel := context.WithTimeout(c.ctx, c.ReadTimeout)
|
||||||
|
Reference in New Issue
Block a user