mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-25 12:26:55 +00:00
add custom routing rule blacklist
This commit is contained in:
parent
5b271108c0
commit
28f7269431
3 changed files with 33 additions and 0 deletions
|
@ -1185,6 +1185,15 @@ namespace v2rayN.Handler
|
||||||
AddBatchRoutingRules(ref item2, result2);
|
AddBatchRoutingRules(ref item2, result2);
|
||||||
config.routings.Add(item2);
|
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;
|
config.routingIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
23
v2rayN/v2rayN/Sample/custom_routing_black
Normal file
23
v2rayN/v2rayN/Sample/custom_routing_black
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
|
@ -402,6 +402,7 @@
|
||||||
<EmbeddedResource Include="Sample\custom_routing_white" />
|
<EmbeddedResource Include="Sample\custom_routing_white" />
|
||||||
<EmbeddedResource Include="Sample\custom_routing_global" />
|
<EmbeddedResource Include="Sample\custom_routing_global" />
|
||||||
<EmbeddedResource Include="Sample\custom_routing_locked" />
|
<EmbeddedResource Include="Sample\custom_routing_locked" />
|
||||||
|
<EmbeddedResource Include="Sample\custom_routing_black" />
|
||||||
<Protobuf Include="Protos\Statistics.proto" />
|
<Protobuf Include="Protos\Statistics.proto" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Reference in a new issue