ForceTCP only for supported clients (#997)

* ForceTCP only for supported clients

Revert back to standard if forceRelay with TLS fails
Don't force TLS unless it's configured

* fix lint
This commit is contained in:
David Zhao
2022-09-09 18:14:36 -07:00
committed by GitHub
parent 47faedc27a
commit 7e3155dcd6
7 changed files with 150 additions and 21 deletions
+12
View File
@@ -324,6 +324,18 @@ func (conf *Config) UseSentinel() bool {
return conf.Redis.SentinelAddresses != nil
}
func (conf *Config) IsTURNSEnabled() bool {
if conf.TURN.Enabled && conf.TURN.TLSPort != 0 {
return true
}
for _, s := range conf.RTC.TURNServers {
if s.Protocol == "tls" {
return true
}
}
return false
}
func (conf *Config) updateFromCLI(c *cli.Context) error {
if c.IsSet("dev") {
conf.Development = c.Bool("dev")