From f6e5cbbba53378555920dab15c091213d17ddeeb Mon Sep 17 00:00:00 2001 From: Tindy X <49061470+tindy2013@users.noreply.github.com> Date: Wed, 4 Oct 2023 02:40:00 +0800 Subject: [PATCH] Add new proxy group options for Loon and Quantumult X --- src/generator/config/subexport.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 434a17796..e55897a8d 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -1491,6 +1491,12 @@ void proxyToQuanX(std::vector &nodes, INIReader &ini, std::vector 0) + singlegroup += ", tolerance=" + std::to_string(x.Tolerance); + } ini.set("{NONAME}", singlegroup); } @@ -1903,10 +1909,22 @@ std::string proxyToLoon(std::vector &nodes, const std::string &base_conf, group += "," + y; */ group += join(filtered_nodelist, ","); - if(x.Type != ProxyGroupType::Select) { + if(x.Type != ProxyGroupType::Select) + { group += ",url=" + x.Url + ",interval=" + std::to_string(x.Interval); - if (x.Type == ProxyGroupType::LoadBalance) - group += ",strategy=" + std::string(x.Strategy == BalanceStrategy::RoundRobin ? "round-robin" : "pcc"); + if(x.Type == ProxyGroupType::LoadBalance) + { + group += ",algorithm=" + std::string(x.Strategy == BalanceStrategy::RoundRobin ? "round-robin" : "pcc"); + if(x.Timeout > 0) + group += ",max-timeout=" + std::to_string(x.Timeout); + } + if(x.Type == ProxyGroupType::URLTest) + { + if(x.Tolerance > 0) + group += ",tolerance=" + std::to_string(x.Tolerance); + } + if(x.Type == ProxyGroupType::Fallback) + group += ",max-timeout=" + std::to_string(x.Timeout); } ini.set("{NONAME}", x.Name + " = " + group); //insert order