mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
add default CertConfig
This commit is contained in:
18
conf/node.go
18
conf/node.go
@@ -29,31 +29,33 @@ func (n *NodeConfig) UnmarshalJSON(data []byte) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
n.ApiConfig = ApiConfig{
|
||||
APIHost: "http://127.0.0.1",
|
||||
Timeout: 30,
|
||||
}
|
||||
if len(r.ApiRaw) > 0 {
|
||||
err = json.Unmarshal(r.ApiRaw, &n.ApiConfig)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
n.ApiConfig = ApiConfig{
|
||||
APIHost: "http://127.0.0.1",
|
||||
Timeout: 30,
|
||||
}
|
||||
err = json.Unmarshal(data, &n.ApiConfig)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
n.Options = Options{
|
||||
ListenIP: "0.0.0.0",
|
||||
SendIP: "0.0.0.0",
|
||||
CertConfig: NewCertConfig(),
|
||||
}
|
||||
if len(r.OptRaw) > 0 {
|
||||
err = json.Unmarshal(r.OptRaw, &n.Options)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
n.Options = Options{
|
||||
ListenIP: "0.0.0.0",
|
||||
SendIP: "0.0.0.0",
|
||||
}
|
||||
err = json.Unmarshal(data, &n.Options)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user