Commit 89a9e6c7 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement command-line option "relay-only".

parent a0418d26
...@@ -39,6 +39,8 @@ func main() { ...@@ -39,6 +39,8 @@ func main() {
flag.StringVar(&mutexprofile, "mutexprofile", "", flag.StringVar(&mutexprofile, "mutexprofile", "",
"store mutex profile in `file`") "store mutex profile in `file`")
flag.BoolVar(&group.UseMDNS, "mdns", false, "gather mDNS addresses") 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() flag.Parse()
if cpuprofile != "" { if cpuprofile != "" {
......
...@@ -22,6 +22,7 @@ type RTCConfiguration struct { ...@@ -22,6 +22,7 @@ type RTCConfiguration struct {
} }
var ICEFilename string var ICEFilename string
var ICERelayOnly bool
var iceConf RTCConfiguration var iceConf RTCConfiguration
var iceOnce sync.Once var iceOnce sync.Once
...@@ -44,6 +45,9 @@ func ICEConfiguration() *RTCConfiguration { ...@@ -44,6 +45,9 @@ func ICEConfiguration() *RTCConfiguration {
iceConf = RTCConfiguration{ iceConf = RTCConfiguration{
ICEServers: iceServers, ICEServers: iceServers,
} }
if ICERelayOnly {
iceConf.ICETransportPolicy = "relay"
}
}) })
return &iceConf return &iceConf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment