mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Enhancements
Add support for Quantumult X IP6-CIDR rules. Add SNI host settings to Surge VMess nodes.
This commit is contained in:
3 files changed
+21
-17
No files matched your search
+8
-3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user