mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-05 05:00:08 +00:00
refactor conf
This commit is contained in:
41
conf/sing.go
41
conf/sing.go
@@ -1,15 +1,15 @@
|
||||
package conf
|
||||
|
||||
type SingConfig struct {
|
||||
LogConfig SingLogConfig `yaml:"LogConfig"`
|
||||
OriginalPath string `yaml:"OriginalPath"`
|
||||
LogConfig SingLogConfig `json:"Log"`
|
||||
OriginalPath string `json:"OriginalPath"`
|
||||
}
|
||||
|
||||
type SingLogConfig struct {
|
||||
Disabled bool `yaml:"Disable"`
|
||||
Level string `yaml:"Level"`
|
||||
Output string `yaml:"Output"`
|
||||
Timestamp bool `yaml:"Timestamp"`
|
||||
Disabled bool `json:"Disable"`
|
||||
Level string `json:"Level"`
|
||||
Output string `json:"Output"`
|
||||
Timestamp bool `json:"Timestamp"`
|
||||
}
|
||||
|
||||
func NewSingConfig() *SingConfig {
|
||||
@@ -20,3 +20,32 @@ func NewSingConfig() *SingConfig {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type SingOptions struct {
|
||||
EnableProxyProtocol bool `json:"EnableProxyProtocol"`
|
||||
TCPFastOpen bool `json:"EnableTFO"`
|
||||
SniffEnabled bool `json:"EnableSniff"`
|
||||
SniffOverrideDestination bool `json:"SniffOverrideDestination"`
|
||||
FallBackConfigs *FallBackConfigForSing `json:"FallBackConfigs"`
|
||||
}
|
||||
|
||||
type FallBackConfigForSing struct {
|
||||
// sing-box
|
||||
FallBack FallBack `json:"FallBack"`
|
||||
FallBackForALPN map[string]FallBack `json:"FallBackForALPN"`
|
||||
}
|
||||
|
||||
type FallBack struct {
|
||||
Server string `json:"Server"`
|
||||
ServerPort string `json:"ServerPort"`
|
||||
}
|
||||
|
||||
func NewSingOptions() *SingOptions {
|
||||
return &SingOptions{
|
||||
EnableProxyProtocol: false,
|
||||
TCPFastOpen: false,
|
||||
SniffEnabled: true,
|
||||
SniffOverrideDestination: true,
|
||||
FallBackConfigs: &FallBackConfigForSing{},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user