Skip to content

Commit

Permalink
Fix TLS protocol type error and add DTLS support (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: Péter Megyesi <peter@megyesi.hu>
  • Loading branch information
Megzo and Péter Megyesi authored Oct 21, 2024
1 parent 2cf7942 commit a026382
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/ice-servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ func formGenericIceServers(config *config.ICEConfig) (adapters.IceServersConfig,
for proto, ports := range config.TurnPorts {
for _, port := range ports {
turnProto := "turn"
l4proto := proto
if proto == "tls" {
turnProto = "turns"
l4proto = "tcp"
}
if proto == "dtls" {
turnProto = "turns"
l4proto = "udp"
}
url := fmt.Sprintf("%s:%s:%d?transport=%s",
turnProto, config.TurnHost, port, proto)
turnProto, config.TurnHost, port, l4proto)

iceServers = append(iceServers,
webrtc.ICEServer{
Expand Down

0 comments on commit a026382

Please sign in to comment.