feat: support UDP in TURN (#61)

1. Add UDP option to TURN
2. GetLocalIPAddress default to IPv4
This commit is contained in:
hn8
2021-07-19 09:21:59 -07:00
committed by GitHub
parent c493022f0f
commit 06c44ca8f6
6 changed files with 83 additions and 42 deletions
+6 -2
View File
@@ -3,7 +3,6 @@ package main
import (
"fmt"
"os"
"strconv"
"time"
"github.com/livekit/protocol/auth"
@@ -40,7 +39,12 @@ func printPorts(c *cli.Context) error {
}
if conf.TURN.Enabled {
tcpPorts = append(tcpPorts, strconv.Itoa(conf.TURN.TLSPort))
if conf.TURN.TLSPort > 0 {
tcpPorts = append(tcpPorts, fmt.Sprintf("%d - TURN/TLS", conf.TURN.TLSPort))
}
if conf.TURN.UDPPort > 0 {
udpPorts = append(udpPorts, fmt.Sprintf("%d - TURN/UDP", conf.TURN.UDPPort))
}
}
fmt.Println("TCP Ports")