mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-04 02:34:06 +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;
|
break;
|
||||||
case "ws"_hash:
|
case "ws"_hash:
|
||||||
singleproxy["network"] = x.TransferProtocol;
|
singleproxy["network"] = x.TransferProtocol;
|
||||||
|
/*
|
||||||
singleproxy["ws-opts"]["path"] = x.Path;
|
singleproxy["ws-opts"]["path"] = x.Path;
|
||||||
if(x.Host.size())
|
if(x.Host.size())
|
||||||
singleproxy["ws-opts"]["headers"]["Host"] = x.Host;
|
singleproxy["ws-opts"]["headers"]["Host"] = x.Host;
|
||||||
if(x.Edge.size())
|
if(x.Edge.size())
|
||||||
singleproxy["ws-opts"]["headers"]["Edge"] = x.Edge;
|
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;
|
break;
|
||||||
case "http"_hash:
|
case "http"_hash:
|
||||||
singleproxy["network"] = x.TransferProtocol;
|
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.AlterId = to_int(aid);
|
||||||
node.EncryptMethod = cipher;
|
node.EncryptMethod = cipher;
|
||||||
node.TransferProtocol = net.empty() ? "tcp" : net;
|
node.TransferProtocol = net.empty() ? "tcp" : net;
|
||||||
node.Host = host.empty() ? add.data() : trim(host);
|
|
||||||
node.Edge = edge;
|
node.Edge = edge;
|
||||||
|
|
||||||
if(net == "ws" || net == "http")
|
if(net == "quic")
|
||||||
node.Path = path.empty() ? "/" : trim(path);
|
{
|
||||||
|
node.QUICSecure = host;
|
||||||
|
node.QUICSecret = path;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(net == "quic")
|
node.Host = host.empty() ? add.data() : trim(host);
|
||||||
{
|
node.Path = path.empty() ? "/" : trim(path);
|
||||||
node.QUICSecure = host;
|
|
||||||
node.QUICSecret = path;
|
|
||||||
}
|
|
||||||
node.FakeType = type;
|
|
||||||
}
|
}
|
||||||
|
node.FakeType = type;
|
||||||
node.TLSSecure = tls == "tls";
|
node.TLSSecure = tls == "tls";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user