From c3e8e88fb6afd7ade6cff13c80e01c595900ea25 Mon Sep 17 00:00:00 2001 From: Tindy X <49061470+tindy2013@users.noreply.github.com> Date: Sun, 8 Oct 2023 02:40:27 +0800 Subject: [PATCH] Add support for SOCKS5 nodes in Loon configs --- src/generator/config/subexport.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index e55897a..51080c2 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -1849,6 +1849,19 @@ std::string proxyToLoon(std::vector &nodes, const std::string &base_conf, if(!scv.is_undef()) proxy += ",skip-cert-verify=" + std::string(scv.get() ? "true" : "false"); break; + case ProxyType::SOCKS5: + proxy = "socks5," + hostname + "," + port; + if (!username.empty() && !password.empty()) + proxy += "," + username + ",\"" + password + "\""; + proxy += ",over-tls=" + std::string(tlssecure ? "true" : "false"); + if (tlssecure) + { + if(!host.empty()) + proxy += ",tls-name=" + host; + if(!scv.is_undef()) + proxy += ",skip-cert-verify=" + std::string(scv.get() ? "true" : "false"); + } + break; default: continue; }