Add manual config mangling for worker

This commit is contained in:
Sergey Stepanov 2021-12-21 23:22:42 +03:00
parent f688f3c5f4
commit 2f841f8946
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B

View file

@ -46,6 +46,7 @@ var configPath string
func NewConfig() (conf Config) {
_ = config.LoadConfig(&conf, configPath)
conf.expandSpecialTags()
conf.fixValues()
return
}
@ -77,6 +78,14 @@ func (c *Config) expandSpecialTags() {
}
}
// fixValues tries to fix some values otherwise hard to set externally.
func (c *Config) fixValues() {
// with ICE lite we clear ICE servers
if c.Webrtc.IceLite {
c.Webrtc.IceServers = []webrtcConfig.IceServer{}
}
}
// GetAddr returns defined in the config server address.
func (w *Worker) GetAddr() string { return w.Server.GetAddr() }