mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-11-04 18:19:42 +08:00
Enhancements
Add support for exporting Clash proxy-provider. Add version info on Web server main page. Fix program crash when no nodes are available in generating Mellow configuration.
This commit is contained in:
parent
050fd8172c
commit
31c638a779
5
main.cpp
5
main.cpp
@ -494,6 +494,11 @@ int main(int argc, char *argv[])
|
|||||||
if(!update_ruleset_on_request)
|
if(!update_ruleset_on_request)
|
||||||
refreshRulesets(rulesets, ruleset_content_array);
|
refreshRulesets(rulesets, ruleset_content_array);
|
||||||
|
|
||||||
|
append_response("GET", "/", "text/plain", [](RESPONSE_CALLBACK_ARGS) -> std::string
|
||||||
|
{
|
||||||
|
return std::string("subconverter " VERSION " backend");
|
||||||
|
});
|
||||||
|
|
||||||
append_response("GET", "/refreshrules", "text/plain", [](RESPONSE_CALLBACK_ARGS) -> std::string
|
append_response("GET", "/refreshrules", "text/plain", [](RESPONSE_CALLBACK_ARGS) -> std::string
|
||||||
{
|
{
|
||||||
return refreshRulesets(rulesets, ruleset_content_array);
|
return refreshRulesets(rulesets, ruleset_content_array);
|
||||||
|
|||||||
@ -552,6 +552,13 @@ std::string netchToClash(std::vector<nodeInfo> &nodes, std::string &base_conf, s
|
|||||||
nodelist.emplace_back(x);
|
nodelist.emplace_back(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ext.nodelist)
|
||||||
|
{
|
||||||
|
YAML::Node provider;
|
||||||
|
provider["proxies"] = proxies;
|
||||||
|
return YAML::Dump(provider);
|
||||||
|
}
|
||||||
|
|
||||||
yamlnode["Proxy"] = proxies;
|
yamlnode["Proxy"] = proxies;
|
||||||
std::string groupname;
|
std::string groupname;
|
||||||
|
|
||||||
@ -1504,7 +1511,12 @@ std::string netchToMellow(std::vector<nodeInfo> &nodes, std::string &base_conf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!filtered_nodelist.size())
|
if(!filtered_nodelist.size())
|
||||||
|
{
|
||||||
|
if(!remarks_list.size())
|
||||||
|
filtered_nodelist.emplace_back("DIRECT");
|
||||||
|
else
|
||||||
filtered_nodelist = remarks_list;
|
filtered_nodelist = remarks_list;
|
||||||
|
}
|
||||||
|
|
||||||
//don't process these for now
|
//don't process these for now
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user