Merge pull request #60 from greatcoolge/master

Update subexport.cpp
This commit is contained in:
asdlokj1qpi23
2025-11-11 09:18:18 +08:00
committed by GitHub
2 changed files with 8 additions and 7 deletions

View File

@@ -560,8 +560,8 @@ void rulesetToSingBox(rapidjson::Document &base_rule, std::vector<RulesetContent
rules.PushBack(direct_object, allocator);
}
auto dns_object = buildObject(allocator, "protocol", "dns", "outbound", "dns-out");
rules.PushBack(dns_object, allocator);
// auto dns_object = buildObject(allocator, "protocol", "dns", "outbound", "dns-out");
// rules.PushBack(dns_object, allocator);
std::vector<std::string_view> temp(4);
for(RulesetContent &x : ruleset_content_array)

View File

@@ -2570,10 +2570,11 @@ proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json,
if (!ext.nodelist) {
auto direct = buildObject(allocator, "type", "direct", "tag", "DIRECT");
outbounds.PushBack(direct, allocator);
auto reject = buildObject(allocator, "type", "block", "tag", "REJECT");
outbounds.PushBack(reject, allocator);
auto dns = buildObject(allocator, "type", "dns", "tag", "dns-out");
outbounds.PushBack(dns, allocator);
// 注释掉 REJECT 和 dns-out
// auto reject = buildObject(allocator, "type", "block", "tag", "REJECT");
// outbounds.PushBack(reject, allocator);
// auto dns = buildObject(allocator, "type", "dns", "tag", "dns-out");
// outbounds.PushBack(dns, allocator);
}
for (Proxy &x: nodes) {
@@ -2774,7 +2775,7 @@ proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json,
tls.AddMember("insecure", buildBooleanValue(scv), allocator);
proxy.AddMember("tls", tls, allocator);
}
if (!x.FakeType.empty())
if (!x.FakeType.empty() && x.FakeType != "none")
proxy.AddMember("network", rapidjson::StringRef(x.FakeType.c_str()), allocator);
if (!x.OBFSParam.empty())
proxy.AddMember("obfs", rapidjson::StringRef(x.OBFSParam.c_str()), allocator);