|
@@ -104,6 +104,7 @@ func GetServerInfo() models.ServerConfig {
|
|
cfg.StunList = GetStunList()
|
|
cfg.StunList = GetStunList()
|
|
cfg.TurnDomain = GetTurnHost()
|
|
cfg.TurnDomain = GetTurnHost()
|
|
cfg.TurnApiDomain = GetTurnApiHost()
|
|
cfg.TurnApiDomain = GetTurnApiHost()
|
|
|
|
+ cfg.TurnPort = GetTurnPort()
|
|
return cfg
|
|
return cfg
|
|
}
|
|
}
|
|
|
|
|
|
@@ -649,6 +650,20 @@ func GetStunPort() int {
|
|
return port
|
|
return port
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// GetTurnPort - Get the port to run the turn server on
|
|
|
|
+func GetTurnPort() int {
|
|
|
|
+ port := 3479 //default
|
|
|
|
+ if os.Getenv("TURN_PORT") != "" {
|
|
|
|
+ portInt, err := strconv.Atoi(os.Getenv("TURN_PORT"))
|
|
|
|
+ if err == nil {
|
|
|
|
+ port = portInt
|
|
|
|
+ }
|
|
|
|
+ } else if config.Config.Server.TurnPort != 0 {
|
|
|
|
+ port = config.Config.Server.TurnPort
|
|
|
|
+ }
|
|
|
|
+ return port
|
|
|
|
+}
|
|
|
|
+
|
|
// IsProxyEnabled - is proxy on or off
|
|
// IsProxyEnabled - is proxy on or off
|
|
func IsProxyEnabled() bool {
|
|
func IsProxyEnabled() bool {
|
|
var enabled = false //default
|
|
var enabled = false //default
|