mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-09-26 23:09:20 +08:00
Enhancements
Fix parsing of some Trojan share links. Add support for latest Surfboard config.
This commit is contained in:
parent
406b0f2022
commit
d70d1db318
@ -644,13 +644,13 @@ std::string proxyToSurge(std::vector<Proxy> &nodes, const std::string &base_conf
|
||||
switch(x.Type)
|
||||
{
|
||||
case ProxyType::Shadowsocks:
|
||||
if(surge_ver >= 3)
|
||||
if(surge_ver >= 3 || surge_ver == -3)
|
||||
{
|
||||
proxy = "ss, " + hostname + ", " + port + ", encrypt-method=" + method + ", password=" + password;
|
||||
}
|
||||
else
|
||||
{
|
||||
proxy = "custom, " + hostname + ", " + port + ", " + method + ", " + password + ", https://github.com/ConnersHua/SSEncrypt/raw/master/SSEncrypt.module";
|
||||
proxy = "custom, " + hostname + ", " + port + ", " + method + ", " + password + ", https://github.com/pobizhe/SSEncrypt/raw/master/SSEncrypt.module";
|
||||
}
|
||||
if(!plugin.empty())
|
||||
{
|
||||
@ -719,8 +719,16 @@ std::string proxyToSurge(std::vector<Proxy> &nodes, const std::string &base_conf
|
||||
if(!scv.is_undef())
|
||||
proxy += ", skip-cert-verify=" + scv.get_str();
|
||||
break;
|
||||
case ProxyType::HTTP:
|
||||
case ProxyType::HTTPS:
|
||||
if(surge_ver == -3)
|
||||
{
|
||||
proxy = "https, " + hostname + ", " + port + ", " + username + ", " + password;
|
||||
if(!scv.is_undef())
|
||||
proxy += ", skip-cert-verify=" + scv.get_str();
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
case ProxyType::HTTP:
|
||||
proxy = "http, " + hostname + ", " + port;
|
||||
if(!username.empty())
|
||||
proxy += ", username=" + username;
|
||||
@ -731,7 +739,7 @@ std::string proxyToSurge(std::vector<Proxy> &nodes, const std::string &base_conf
|
||||
proxy += ", skip-cert-verify=" + scv.get_str();
|
||||
break;
|
||||
case ProxyType::Trojan:
|
||||
if(surge_ver < 4)
|
||||
if(surge_ver < 4 && surge_ver != -3)
|
||||
continue;
|
||||
proxy = "trojan, " + hostname + ", " + port + ", password=" + password;
|
||||
if(x.SnellVersion != 0)
|
||||
@ -1356,6 +1364,10 @@ void proxyToQuanX(std::vector<Proxy> &nodes, INIReader &ini, std::vector<Ruleset
|
||||
if(!tls13.is_undef())
|
||||
proxyStr += ", tls13=" + std::string(tls13 ? "true" : "false");
|
||||
}
|
||||
else
|
||||
{
|
||||
proxyStr += ", over-tls=false";
|
||||
}
|
||||
break;
|
||||
case ProxyType::Trojan:
|
||||
proxyStr = "trojan = " + hostname + ":" + port + ", password=" + password;
|
||||
@ -1365,6 +1377,10 @@ void proxyToQuanX(std::vector<Proxy> &nodes, INIReader &ini, std::vector<Ruleset
|
||||
if(!tls13.is_undef())
|
||||
proxyStr += ", tls13=" + std::string(tls13 ? "true" : "false");
|
||||
}
|
||||
else
|
||||
{
|
||||
proxyStr += ", over-tls=false";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
|
@ -747,7 +747,9 @@ void explodeTrojan(std::string trojan, Proxy &node)
|
||||
if(port == "0")
|
||||
return;
|
||||
|
||||
host = getUrlArg(addition, "peer");
|
||||
host = getUrlArg(addition, "sni");
|
||||
if(host.empty())
|
||||
host = getUrlArg(addition, "peer");
|
||||
tfo = getUrlArg(addition, "tfo");
|
||||
scv = getUrlArg(addition, "allowInsecure");
|
||||
group = urlDecode(getUrlArg(addition, "group"));
|
||||
|
Loading…
Reference in New Issue
Block a user