mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Enhancements
Fix potential crash related to the new file reader. Fix loading local subscriptions requires token when API mode is disabled. Add support for parsing Clash Proxy Provider. Update READMEs.
This commit is contained in:
5 files changed
+104
-42
No files matched your search
@@ -736,9 +736,10 @@ void explodeClash(Node yamlnode, std::string custom_port, int local_port, std::v
|
||||
std::string plugin, pluginopts, pluginopts_mode, pluginopts_host, pluginopts_mux; //ss
|
||||
std::string protocol, protoparam, obfs, obfsparam; //ssr
|
||||
std::string user; //socks
|
||||
for(unsigned int i = 0; i < yamlnode["Proxy"].size(); i++)
|
||||
const std::string section = yamlnode["proxies"].IsDefined() ? "proxies" : "Proxy";
|
||||
for(unsigned int i = 0; i < yamlnode[section].size(); i++)
|
||||
{
|
||||
singleproxy = yamlnode["Proxy"][i];
|
||||
singleproxy = yamlnode[section][i];
|
||||
singleproxy["type"] >> proxytype;
|
||||
singleproxy["name"] >> ps;
|
||||
singleproxy["server"] >> server;
|
||||
@@ -1521,10 +1522,10 @@ void explodeSub(std::string sub, bool sslibev, bool ssrlibev, std::string custom
|
||||
//try to parse as clash configuration
|
||||
try
|
||||
{
|
||||
if(!processed && strFind(sub, "Proxy"))
|
||||
if(!processed && (strFind(sub, "Proxy:") || strFind(sub, "proxies:")))
|
||||
{
|
||||
Node yamlnode = Load(sub);
|
||||
if(yamlnode.size() && yamlnode["Proxy"])
|
||||
if(yamlnode.size() && (yamlnode["Proxy"].IsDefined() || yamlnode["proxies"].IsDefined()))
|
||||
{
|
||||
explodeClash(yamlnode, custom_port, local_port, nodes, sslibev, ssrlibev);
|
||||
processed = true;
|
||||
|
||||
Reference in new issue
Block a user