fix: convert accept obfs/obfs-host as aliases for mode/host in ss v2ray-plugin URL (#2712)

This commit is contained in:
beck
2026-04-15 16:49:36 +08:00
committed by GitHub
parent 6c407f0f93
commit 83ac220f54
+10 -2
View File
@@ -453,10 +453,18 @@ func ConvertsV2Ray(buf []byte) ([]map[string]any, error) {
"host": pluginInfo.Get("obfs-host"),
}
} else if strings.Contains(pluginName, "v2ray-plugin") {
mode := pluginInfo.Get("mode")
if mode == "" {
mode = pluginInfo.Get("obfs")
}
host := pluginInfo.Get("host")
if host == "" {
host = pluginInfo.Get("obfs-host")
}
ss["plugin"] = "v2ray-plugin"
ss["plugin-opts"] = map[string]any{
"mode": pluginInfo.Get("mode"),
"host": pluginInfo.Get("host"),
"mode": mode,
"host": host,
"path": pluginInfo.Get("path"),
"tls": strings.Contains(plugin, "tls"),
}