mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
configure ipv4/6 in config file
This commit is contained in:
parent
fb65203805
commit
8d0adf253d
1 changed files with 9 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ type OperatorConfig struct {
|
|||
}
|
||||
|
||||
type ListenerConfig struct {
|
||||
Net string
|
||||
Address string
|
||||
Key string
|
||||
Certificate string
|
||||
|
|
@ -39,5 +40,13 @@ func LoadConfig() (config *Config, err error) {
|
|||
|
||||
decoder := json.NewDecoder(file)
|
||||
err = decoder.Decode(config)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, lconf := range config.Listeners {
|
||||
if lconf.Net == "" {
|
||||
lconf.Net = "tcp"
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue