mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 13:42:51 +08:00
fix: remove routing rules when testing
This commit is contained in:
parent
4b742595e4
commit
3b56d8b429
@ -682,16 +682,23 @@ namespace Configs {
|
||||
// custom inbound
|
||||
if (!status->forTest) QJSONARRAY_ADD(status->inbounds, QString2QJsonObject(dataStore->custom_inbound)["inbounds"].toArray())
|
||||
|
||||
// DNS hijack deps
|
||||
QJsonArray hijackDomains;
|
||||
QJsonArray hijackDomainSuffix;
|
||||
QJsonArray hijackDomainRegex;
|
||||
QJsonArray hijackGeoAssets;
|
||||
|
||||
// manage routing section
|
||||
auto routeObj = QJsonObject();
|
||||
if (!status->forTest) {
|
||||
if (dataStore->spmode_vpn) {
|
||||
routeObj["auto_detect_interface"] = true;
|
||||
}
|
||||
if (dataStore->enable_stats && !status->forTest)
|
||||
if (dataStore->enable_stats)
|
||||
{
|
||||
routeObj["find_process"] = true;
|
||||
}
|
||||
if (!status->forTest) routeObj["final"] = outboundIDToString(routeChain->defaultOutboundID);
|
||||
routeObj["final"] = outboundIDToString(routeChain->defaultOutboundID);
|
||||
|
||||
if (!dataStore->routing->domain_strategy.isEmpty())
|
||||
{
|
||||
@ -742,13 +749,7 @@ namespace Configs {
|
||||
auto routeRules = routeChain->get_route_rules(false, outboundMap);
|
||||
routeObj["rules"] = routeRules;
|
||||
|
||||
// DNS hijack deps
|
||||
QJsonArray hijackDomains;
|
||||
QJsonArray hijackDomainSuffix;
|
||||
QJsonArray hijackDomainRegex;
|
||||
QJsonArray hijackGeoAssets;
|
||||
|
||||
if (dataStore->enable_dns_server && !status->forTest) {
|
||||
if (dataStore->enable_dns_server) {
|
||||
for (const auto& rule : dataStore->dns_server_rules) {
|
||||
if (rule.startsWith("ruleset:")) {
|
||||
hijackGeoAssets << rule.mid(8);
|
||||
@ -797,6 +798,7 @@ namespace Configs {
|
||||
};
|
||||
}
|
||||
routeObj["rule_set"] = ruleSetArray;
|
||||
}
|
||||
|
||||
// DNS settings
|
||||
QJsonObject dns;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user