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:
Tindy X committed 2020-02-22 02:49:41 +08:00
1 parent 0527f1ddd4
commit e3726192dd
5 files changed
+104 -42

No files matched your search

+5 -4
View File
@@ -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;