Enhancements

Add support for Quantumult X IP6-CIDR rules.
Add SNI host settings to Surge VMess nodes.
This commit is contained in:
Tindy X committed 2020-05-04 23:59:43 +08:00
1 parent 23d64632de
commit af7d7fae05
3 files changed
+21 -17

No files matched your search

+8 -3
View File
@@ -834,9 +834,12 @@ void rulesetToSurge(INIReader &base_rule, std::vector<ruleset_content> &ruleset_
/// remove unsupported types
switch(surge_ver)
{
case -1:
case -2:
if(!std::any_of(quanx_rule_type.begin(), quanx_rule_type.end(), [strLine](std::string type){return startsWith(strLine, type);}) || startsWith(strLine, "IP-CIDR6"))
if(startsWith(strLine, "IP-CIDR6"))
continue;
[[fallthrough]];
case -1:
if(!std::any_of(quanx_rule_type.begin(), quanx_rule_type.end(), [strLine](std::string type){return startsWith(strLine, type);}))
continue;
break;
case -3:
@@ -859,6 +862,8 @@ void rulesetToSurge(INIReader &base_rule, std::vector<ruleset_content> &ruleset_
strLine += "," + rule_group;
if(surge_ver == -1 || surge_ver == -2)
{
if(startsWith(strLine, "IP-CIDR6"))
strLine.replace(0, 8, "IP6-CIDR");
if(std::count(strLine.begin(), strLine.end(), ',') > 2 && regReplace(strLine, rule_match_regex, "$2") == ",no-resolve")
strLine = regReplace(strLine, rule_match_regex, "$1$3$2");
else
@@ -1388,7 +1393,7 @@ std::string netchToSurge(std::vector<nodeInfo> &nodes, std::string &base_conf, s
case "tcp"_hash:
break;
case "ws"_hash:
proxy += ", ws=true, ws-path=" + path + ", ws-headers=Host:" + host;
proxy += ", ws=true, ws-path=" + path + ", sni=" + host + ", ws-headers=Host:" + host;
if(edge.size())
proxy += "|Edge:" + edge;
break;