feat: support UDP in TURN (#61)
1. Add UDP option to TURN 2. GetLocalIPAddress default to IPv4
This commit is contained in:
+5
-2
@@ -41,12 +41,15 @@ func GetLocalIPAddress() (string, error) {
|
||||
var ip net.IP
|
||||
switch v := addr.(type) {
|
||||
case *net.IPNet:
|
||||
ip = v.IP
|
||||
ip = v.IP.To4()
|
||||
case *net.IPAddr:
|
||||
ip = v.IP
|
||||
ip = v.IP.To4()
|
||||
default:
|
||||
continue
|
||||
}
|
||||
if ip == nil {
|
||||
continue
|
||||
}
|
||||
if ip.IsLoopback() {
|
||||
loopBack = ip.String()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user