use route group to storage extra config

This commit is contained in:
yuzuki999
2023-06-25 08:22:05 +08:00
parent 9af5d1a6e7
commit 07b7ec9b3e
7 changed files with 100 additions and 29 deletions

View File

@@ -102,6 +102,25 @@ func BuildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
}
}
}
// use remote reality replace local config
if nodeInfo.ExtraConfig.EnableReality {
rc := nodeInfo.ExtraConfig.RealityConfig
in.StreamSetting.Security = "reality"
d, err := json.Marshal(rc.Dest)
if err != nil {
return nil, fmt.Errorf("marshal reality dest error: %s", err)
}
in.StreamSetting.REALITYSettings = &coreConf.REALITYConfig{
Dest: d,
Xver: rc.Xver,
ServerNames: rc.ServerNames,
PrivateKey: rc.PrivateKey,
MinClientVer: rc.MinClientVer,
MaxClientVer: rc.MaxClientVer,
MaxTimeDiff: rc.MaxTimeDiff,
ShortIds: rc.ShortIds,
}
}
// Support ProxyProtocol for any transport protocol
if *in.StreamSetting.Network != "tcp" &&
*in.StreamSetting.Network != "ws" &&
@@ -117,7 +136,8 @@ func BuildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
}
func buildV2ray(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
if config.XrayOptions.EnableVless {
if config.XrayOptions.EnableVless ||
nodeInfo.ExtraConfig.EnableVless {
//Set vless
inbound.Protocol = "vless"
if config.XrayOptions.EnableFallback {