add custom routing rule blacklist

This commit is contained in:
windfallw 2021-05-24 21:28:22 +08:00
parent 5b271108c0
commit 28f7269431
3 changed files with 33 additions and 0 deletions

View file

@ -1185,6 +1185,15 @@ namespace v2rayN.Handler
AddBatchRoutingRules(ref item2, result2);
config.routings.Add(item2);
//Blacklist
var item3 = new RoutingItem();
item3.remarks = "黑名单(Blacklist)";
item3.url = string.Empty;
item3.rules = new List<RulesItem>();
string result3 = Utils.GetEmbedText(Global.CustomRoutingFileName + "black");
AddBatchRoutingRules(ref item3, result3);
config.routings.Add(item3);
config.routingIndex = 0;
}

View file

@ -0,0 +1,23 @@
[
{
"outboundTag": "block",
"domain": [
"geosite:category-ads-all"
]
},
{
"outboundTag": "Proxy",
"domain": [
"geosite:tld-!cn",
"geosite:gfw",
"geosite:greatfire"
],
"ip": [
"geoip:telegram"
]
},
{
"port": "0-65535",
"outboundTag": "direct"
}
]

View file

@ -402,6 +402,7 @@
<EmbeddedResource Include="Sample\custom_routing_white" />
<EmbeddedResource Include="Sample\custom_routing_global" />
<EmbeddedResource Include="Sample\custom_routing_locked" />
<EmbeddedResource Include="Sample\custom_routing_black" />
<Protobuf Include="Protos\Statistics.proto" />
</ItemGroup>
<ItemGroup>