mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-06 05:30:08 +00:00
update sing-box support
This commit is contained in:
21
conf/conf.go
21
conf/conf.go
@@ -2,9 +2,10 @@ package conf
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gopkg.in/yaml.v3"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type Conf struct {
|
||||
@@ -15,16 +16,9 @@ type Conf struct {
|
||||
func New() *Conf {
|
||||
return &Conf{
|
||||
CoreConfig: CoreConfig{
|
||||
Type: "xray",
|
||||
XrayConfig: &XrayConfig{
|
||||
LogConfig: NewLogConfig(),
|
||||
AssetPath: "/etc/V2bX/",
|
||||
DnsConfigPath: "",
|
||||
InboundConfigPath: "",
|
||||
OutboundConfigPath: "",
|
||||
RouteConfigPath: "",
|
||||
ConnectionConfig: NewConnectionConfig(),
|
||||
},
|
||||
Type: "xray",
|
||||
XrayConfig: NewXrayConfig(),
|
||||
SingConfig: NewSingConfig(),
|
||||
},
|
||||
NodesConfig: []*NodeConfig{},
|
||||
}
|
||||
@@ -44,10 +38,5 @@ func (p *Conf) LoadFromPath(filePath string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("decode config error: %s", err)
|
||||
}
|
||||
old := &OldConfig{}
|
||||
err = yaml.Unmarshal(content, old)
|
||||
if err == nil {
|
||||
migrateOldConfig(p, old)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user