兼容Xboard Hysteria2的Obfs写法

This commit is contained in:
wyx2685
2023-11-19 14:35:12 +09:00
parent 607264af87
commit de3b15fcba
4 changed files with 19 additions and 14 deletions

View File

@@ -210,11 +210,16 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
case "hysteria2":
in.Type = "hysteria2"
var obfs *option.Hysteria2Obfs
if info.Hysteria2.ObfsType != "" {
if info.Hysteria2.ObfsType != "" && info.Hysteria2.ObfsPassword != "" {
obfs = &option.Hysteria2Obfs{
Type: info.Hysteria2.ObfsType,
Password: info.Hysteria2.ObfsPassword,
}
} else if info.Hysteria2.ObfsType != "" {
obfs = &option.Hysteria2Obfs{
Type: "salamander",
Password: info.Hysteria2.ObfsType,
}
}
in.Hysteria2Options = option.Hysteria2InboundOptions{
ListenOptions: listen,