mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
chore: rollback reality config, it remains effective.
This commit is contained in:
parent
7a1be2e594
commit
19e5ac8a0c
13
conf/node.go
13
conf/node.go
@ -23,12 +23,24 @@ type ControllerConfig struct {
|
|||||||
CertConfig *CertConfig `yaml:"CertConfig"`
|
CertConfig *CertConfig `yaml:"CertConfig"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RealityConfig struct {
|
||||||
|
Dest interface{} `yaml:"Dest" json:"Dest"`
|
||||||
|
Xver uint64 `yaml:"Xver" json:"Xver"`
|
||||||
|
ServerNames []string `yaml:"ServerNames" json:"ServerNames"`
|
||||||
|
PrivateKey string `yaml:"PrivateKey" json:"PrivateKey"`
|
||||||
|
MinClientVer string `yaml:"MinClientVer" json:"MinClientVer"`
|
||||||
|
MaxClientVer string `yaml:"MaxClientVer" json:"MaxClientVer"`
|
||||||
|
MaxTimeDiff uint64 `yaml:"MaxTimeDiff" json:"MaxTimeDiff"`
|
||||||
|
ShortIds []string `yaml:"ShortIds" json:"ShortIds"`
|
||||||
|
}
|
||||||
|
|
||||||
type XrayOptions struct {
|
type XrayOptions struct {
|
||||||
EnableProxyProtocol bool `yaml:"EnableProxyProtocol"`
|
EnableProxyProtocol bool `yaml:"EnableProxyProtocol"`
|
||||||
EnableDNS bool `yaml:"EnableDNS"`
|
EnableDNS bool `yaml:"EnableDNS"`
|
||||||
DNSType string `yaml:"DNSType"`
|
DNSType string `yaml:"DNSType"`
|
||||||
EnableUot bool `yaml:"EnableUot"`
|
EnableUot bool `yaml:"EnableUot"`
|
||||||
EnableTFO bool `yaml:"EnableTFO"`
|
EnableTFO bool `yaml:"EnableTFO"`
|
||||||
|
EnableVless bool `yaml:"EnableVless"`
|
||||||
DisableIVCheck bool `yaml:"DisableIVCheck"`
|
DisableIVCheck bool `yaml:"DisableIVCheck"`
|
||||||
DisableSniffing bool `yaml:"DisableSniffing"`
|
DisableSniffing bool `yaml:"DisableSniffing"`
|
||||||
EnableFallback bool `yaml:"EnableFallback"`
|
EnableFallback bool `yaml:"EnableFallback"`
|
||||||
@ -97,4 +109,5 @@ type CertConfig struct {
|
|||||||
Provider string `yaml:"Provider"` // alidns, cloudflare, gandi, godaddy....
|
Provider string `yaml:"Provider"` // alidns, cloudflare, gandi, godaddy....
|
||||||
Email string `yaml:"Email"`
|
Email string `yaml:"Email"`
|
||||||
DNSEnv map[string]string `yaml:"DNSEnv"`
|
DNSEnv map[string]string `yaml:"DNSEnv"`
|
||||||
|
RealityConfig *RealityConfig `yaml:"RealityConfig"`
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,24 @@ func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
|||||||
}
|
}
|
||||||
switch config.CertConfig.CertMode {
|
switch config.CertConfig.CertMode {
|
||||||
case "none", "": // disable
|
case "none", "": // disable
|
||||||
|
case "reality":
|
||||||
|
// Reality
|
||||||
|
in.StreamSetting.Security = "reality"
|
||||||
|
d, err := json.Marshal(config.CertConfig.RealityConfig.Dest)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("marshal reality dest error: %s", err)
|
||||||
|
}
|
||||||
|
in.StreamSetting.REALITYSettings = &coreConf.REALITYConfig{
|
||||||
|
Dest: d,
|
||||||
|
Xver: config.CertConfig.RealityConfig.Xver,
|
||||||
|
ServerNames: config.CertConfig.RealityConfig.ServerNames,
|
||||||
|
PrivateKey: config.CertConfig.RealityConfig.PrivateKey,
|
||||||
|
MinClientVer: config.CertConfig.RealityConfig.MinClientVer,
|
||||||
|
MaxClientVer: config.CertConfig.RealityConfig.MaxClientVer,
|
||||||
|
MaxTimeDiff: config.CertConfig.RealityConfig.MaxTimeDiff,
|
||||||
|
ShortIds: config.CertConfig.RealityConfig.ShortIds,
|
||||||
|
}
|
||||||
|
case "remote":
|
||||||
default:
|
default:
|
||||||
if nodeInfo.ExtraConfig.EnableReality {
|
if nodeInfo.ExtraConfig.EnableReality {
|
||||||
rc := nodeInfo.ExtraConfig.RealityConfig
|
rc := nodeInfo.ExtraConfig.RealityConfig
|
||||||
@ -120,7 +138,7 @@ func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
|||||||
}
|
}
|
||||||
|
|
||||||
func buildV2ray(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
|
func buildV2ray(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
|
||||||
if nodeInfo.ExtraConfig.EnableVless {
|
if config.XrayOptions.EnableVless || nodeInfo.ExtraConfig.EnableVless {
|
||||||
//Set vless
|
//Set vless
|
||||||
inbound.Protocol = "vless"
|
inbound.Protocol = "vless"
|
||||||
if config.XrayOptions.EnableFallback {
|
if config.XrayOptions.EnableFallback {
|
||||||
|
Loading…
Reference in New Issue
Block a user