From edc7d90581a07ec73617ff0b8414aeba00b6bb4d Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 26 Jul 2023 04:09:03 +0000 Subject: [PATCH 1/4] fix surge obfs-host empty error --- src/generator/config/subexport.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 6dcb9fc8f..3158f7ed2 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -754,7 +754,9 @@ std::string proxyToSurge(std::vector &nodes, const std::string &base_conf case ProxyType::Snell: proxy = "snell, " + hostname + ", " + port + ", psk=" + password; if(!obfs.empty()) - proxy += ", obfs=" + obfs + ", obfs-host=" + host; + proxy += ", obfs=" + obfs; + if(!host.empty()) + proxy += ", obfs-host=" + host break; default: continue; From 4fd266ecaaf218b1edcda0c448ad087b84a739d6 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 26 Jul 2023 04:23:14 +0000 Subject: [PATCH 2/4] fix comma error --- src/generator/config/subexport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 3158f7ed2..dbeff7fac 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -756,7 +756,7 @@ std::string proxyToSurge(std::vector &nodes, const std::string &base_conf if(!obfs.empty()) proxy += ", obfs=" + obfs; if(!host.empty()) - proxy += ", obfs-host=" + host + proxy += ", obfs-host=" + host; break; default: continue; From e51f64be6efc15cfc4a44081913cebb5067c2d5d Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 2 Aug 2023 06:58:04 +0000 Subject: [PATCH 3/4] UDP is not supported for clash when using snell --- src/generator/config/subexport.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index dbeff7fac..29700a69f 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -443,7 +443,9 @@ void proxyToClash(std::vector &nodes, YAML::Node &yamlnode, const ProxyGr continue; } - if(udp) + // UDP is not supported yet in clash using snell + // sees in https://dreamacro.github.io/clash/configuration/outbound.html#snell + if(udp && x.Type != ProxyType::Snell) singleproxy["udp"] = true; if(block) singleproxy.SetStyle(YAML::EmitterStyle::Block); From e8c9c8886b8069aa7559894eb0cd01ea25a5131e Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 2 Aug 2023 08:12:44 +0000 Subject: [PATCH 4/4] fix brace warning --- src/generator/config/subexport.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 29700a69f..438cf1fa1 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -756,9 +756,11 @@ std::string proxyToSurge(std::vector &nodes, const std::string &base_conf case ProxyType::Snell: proxy = "snell, " + hostname + ", " + port + ", psk=" + password; if(!obfs.empty()) + { proxy += ", obfs=" + obfs; if(!host.empty()) proxy += ", obfs-host=" + host; + } break; default: continue;