Skip to content

Commit

Permalink
Add new proxy group options for Loon and Quantumult X
Browse files Browse the repository at this point in the history
  • Loading branch information
tindy2013 committed Oct 3, 2023
1 parent 69cf9c3 commit f6e5cbb
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/generator/config/subexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,12 @@ void proxyToQuanX(std::vector<Proxy> &nodes, INIReader &ini, std::vector<Ruleset
std::string proxies = join(filtered_nodelist, ", ");

std::string singlegroup = type + "=" + x.Name + ", " + proxies;
if(type != "static")
{
singlegroup += ", check-interval=" + std::to_string(x.Interval);
if(x.Tolerance > 0)
singlegroup += ", tolerance=" + std::to_string(x.Tolerance);
}
ini.set("{NONAME}", singlegroup);
}

Expand Down Expand Up @@ -1903,10 +1909,22 @@ std::string proxyToLoon(std::vector<Proxy> &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
Expand Down

0 comments on commit f6e5cbb

Please sign in to comment.