diff --git a/galene.go b/galene.go index cf537eb..b50f2e8 100644 --- a/galene.go +++ b/galene.go @@ -39,6 +39,8 @@ func main() { flag.StringVar(&mutexprofile, "mutexprofile", "", "store mutex profile in `file`") flag.BoolVar(&group.UseMDNS, "mdns", false, "gather mDNS addresses") + flag.BoolVar(&group.ICERelayOnly, "relay-only", false, + "require use of TURN relays for all media traffic") flag.Parse() if cpuprofile != "" { diff --git a/group/ice.go b/group/ice.go index c79d8d2..243381d 100644 --- a/group/ice.go +++ b/group/ice.go @@ -22,6 +22,7 @@ type RTCConfiguration struct { } var ICEFilename string +var ICERelayOnly bool var iceConf RTCConfiguration var iceOnce sync.Once @@ -44,6 +45,9 @@ func ICEConfiguration() *RTCConfiguration { iceConf = RTCConfiguration{ ICEServers: iceServers, } + if ICERelayOnly { + iceConf.ICETransportPolicy = "relay" + } }) return &iceConf