V2bX/conf/sing.go

52 lines
1.3 KiB
Go
Raw Normal View History

2023-07-29 06:47:47 -04:00
package conf
type SingConfig struct {
2023-08-20 03:13:52 -04:00
LogConfig SingLogConfig `json:"Log"`
OriginalPath string `json:"OriginalPath"`
2023-07-29 06:47:47 -04:00
}
type SingLogConfig struct {
2023-08-20 03:13:52 -04:00
Disabled bool `json:"Disable"`
Level string `json:"Level"`
Output string `json:"Output"`
Timestamp bool `json:"Timestamp"`
2023-07-29 06:47:47 -04:00
}
func NewSingConfig() *SingConfig {
return &SingConfig{
LogConfig: SingLogConfig{
Level: "error",
Timestamp: true,
},
}
}
2023-08-20 03:13:52 -04:00
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{},
}
}