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:
47
conf/xray.go
Normal file
47
conf/xray.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package conf
|
||||
|
||||
type XrayConfig struct {
|
||||
LogConfig *XrayLogConfig `yaml:"Log"`
|
||||
AssetPath string `yaml:"AssetPath"`
|
||||
DnsConfigPath string `yaml:"DnsConfigPath"`
|
||||
RouteConfigPath string `yaml:"RouteConfigPath"`
|
||||
ConnectionConfig *XrayConnectionConfig `yaml:"XrayConnectionConfig"`
|
||||
InboundConfigPath string `yaml:"InboundConfigPath"`
|
||||
OutboundConfigPath string `yaml:"OutboundConfigPath"`
|
||||
}
|
||||
|
||||
type XrayLogConfig struct {
|
||||
Level string `yaml:"Level"`
|
||||
AccessPath string `yaml:"AccessPath"`
|
||||
ErrorPath string `yaml:"ErrorPath"`
|
||||
}
|
||||
|
||||
type XrayConnectionConfig struct {
|
||||
Handshake uint32 `yaml:"handshake"`
|
||||
ConnIdle uint32 `yaml:"connIdle"`
|
||||
UplinkOnly uint32 `yaml:"uplinkOnly"`
|
||||
DownlinkOnly uint32 `yaml:"downlinkOnly"`
|
||||
BufferSize int32 `yaml:"bufferSize"`
|
||||
}
|
||||
|
||||
func NewXrayConfig() *XrayConfig {
|
||||
return &XrayConfig{
|
||||
LogConfig: &XrayLogConfig{
|
||||
Level: "warning",
|
||||
AccessPath: "",
|
||||
ErrorPath: "",
|
||||
},
|
||||
AssetPath: "/etc/V2bX/",
|
||||
DnsConfigPath: "",
|
||||
InboundConfigPath: "",
|
||||
OutboundConfigPath: "",
|
||||
RouteConfigPath: "",
|
||||
ConnectionConfig: &XrayConnectionConfig{
|
||||
Handshake: 4,
|
||||
ConnIdle: 30,
|
||||
UplinkOnly: 2,
|
||||
DownlinkOnly: 4,
|
||||
BufferSize: 64,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user