mirror of
https://github.com/aler9/gortsplib
synced 2025-09-26 19:21:20 +08:00
18 lines
314 B
Go
18 lines
314 B
Go
package gortsplib
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
// do not listen on IPv6 when address is 0.0.0.0.
|
|
func restrictNetwork(network string, address string) (string, string) {
|
|
host, _, err := net.SplitHostPort(address)
|
|
if err == nil {
|
|
if host == "0.0.0.0" {
|
|
return network + "4", address
|
|
}
|
|
}
|
|
|
|
return network, address
|
|
}
|