automatic configuration of TURN, with per-room credentials. version 0.6.0

This commit is contained in:
David Zhao
2021-03-07 23:30:21 -08:00
parent 048cdf9751
commit e20c831c14
18 changed files with 220 additions and 79 deletions
+3 -3
View File
@@ -47,15 +47,15 @@ func TestTurnServer(t *testing.T) {
require.NoError(t, roomStore.CreateRoom(rm))
turnConf := &turn.ClientConfig{
STUNServerAddr: fmt.Sprintf("localhost:%d", conf.TURN.ListenPort),
TURNServerAddr: fmt.Sprintf("%s:%d", currentNode.Ip, conf.TURN.ListenPort),
STUNServerAddr: fmt.Sprintf("localhost:%d", conf.TURN.UDPPort),
TURNServerAddr: fmt.Sprintf("%s:%d", currentNode.Ip, conf.TURN.UDPPort),
Username: rm.Name,
Password: rm.TurnPassword,
Realm: "livekit",
}
t.Run("TURN works over TCP", func(t *testing.T) {
conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%d", conf.TURN.ListenPort))
conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%d", conf.TURN.TCPPort))
require.NoError(t, err)
tc := *turnConf