mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Fix some generated VMess nodes have incomplete config
Revert to legacy Clash VMess-WS node format for backward compatibility.
This commit is contained in:
2 files changed
+15
-9
No files matched your search
@@ -367,11 +367,18 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
|
||||
break;
|
||||
case "ws"_hash:
|
||||
singleproxy["network"] = x.TransferProtocol;
|
||||
/*
|
||||
singleproxy["ws-opts"]["path"] = x.Path;
|
||||
if(x.Host.size())
|
||||
singleproxy["ws-opts"]["headers"]["Host"] = x.Host;
|
||||
if(x.Edge.size())
|
||||
singleproxy["ws-opts"]["headers"]["Edge"] = x.Edge;
|
||||
*/
|
||||
singleproxy["ws-path"] = x.Path;
|
||||
if(x.Host.size())
|
||||
singleproxy["ws-headers"]["Host"] = x.Host;
|
||||
if(x.Edge.size())
|
||||
singleproxy["ws-headers"]["Edge"] = x.Edge;
|
||||
break;
|
||||
case "http"_hash:
|
||||
singleproxy["network"] = x.TransferProtocol;
|
||||
|
||||
@@ -44,20 +44,19 @@ void vmessConstruct(Proxy &node, const std::string &group, const std::string &re
|
||||
node.AlterId = to_int(aid);
|
||||
node.EncryptMethod = cipher;
|
||||
node.TransferProtocol = net.empty() ? "tcp" : net;
|
||||
node.Host = host.empty() ? add.data() : trim(host);
|
||||
node.Edge = edge;
|
||||
|
||||
if(net == "ws" || net == "http")
|
||||
node.Path = path.empty() ? "/" : trim(path);
|
||||
if(net == "quic")
|
||||
{
|
||||
node.QUICSecure = host;
|
||||
node.QUICSecret = path;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(net == "quic")
|
||||
{
|
||||
node.QUICSecure = host;
|
||||
node.QUICSecret = path;
|
||||
}
|
||||
node.FakeType = type;
|
||||
node.Host = host.empty() ? add.data() : trim(host);
|
||||
node.Path = path.empty() ? "/" : trim(path);
|
||||
}
|
||||
node.FakeType = type;
|
||||
node.TLSSecure = tls == "tls";
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user