Fix missing network field in Clash Trojan WebSocket nodes (#431 #448)

Optimize codes.
This commit is contained in:
Tindy X
2022-01-21 03:43:27 +08:00
parent 9b5e01acd3
commit 9419738959
2 changed files with 2 additions and 1 deletions

View File

@@ -423,6 +423,7 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
singleproxy["grpc-opts"]["grpc-service-name"] = x.Path;
break;
case "ws"_hash:
singleproxy["network"] = x.TransferProtocol;
singleproxy["ws-opts"]["path"] = x.Path;
if(!x.Host.empty())
singleproxy["ws-opts"]["headers"]["Host"] = x.Host;

View File

@@ -1011,7 +1011,7 @@ void explodeClash(Node yamlnode, std::vector<Proxy> &nodes)
switch(hash_(safe_as<std::string>(singleproxy["plugin"])))
{
case "obfs"_hash:
plugin = "simple-obfs";
plugin = "obfs-local";
if(singleproxy["plugin-opts"].IsDefined())
{
singleproxy["plugin-opts"]["mode"] >>= pluginopts_mode;