Built-in routing rule set upgraded to V2

pull/4991/head
2dust 2024-04-10 10:50:52 +08:00
parent 5c0c07c78f
commit d961ea22a6
4 changed files with 12 additions and 19 deletions

View File

@ -1674,14 +1674,15 @@ namespace v2rayN.Handler
public static int InitBuiltinRouting(Config config, bool blImportAdvancedRules = false)
{
var ver = "V2-";
var items = LazyConfig.Instance.RoutingItems();
if (blImportAdvancedRules || items.Count <= 0)
if (blImportAdvancedRules || items.Where(t => t.remarks.StartsWith(ver)).ToList().Count <= 0)
{
var maxSort = items.Count;
//Bypass the mainland
var item2 = new RoutingItem()
{
remarks = "绕过大陆(Whitelist)",
remarks = $"{ver}绕过大陆(Whitelist)",
url = string.Empty,
sort = maxSort + 1,
};
@ -1690,7 +1691,7 @@ namespace v2rayN.Handler
//Blacklist
var item3 = new RoutingItem()
{
remarks = "黑名单(Blacklist)",
remarks = $"{ver}黑名单(Blacklist)",
url = string.Empty,
sort = maxSort + 2,
};
@ -1699,7 +1700,7 @@ namespace v2rayN.Handler
//Global
var item1 = new RoutingItem()
{
remarks = "全局(Global)",
remarks = $"{ver}全局(Global)",
url = string.Empty,
sort = maxSort + 3,
};

View File

@ -13,20 +13,10 @@
},
{
"outboundTag": "proxy",
"ip": [
"geoip:cloudflare",
"geoip:cloudfront",
"geoip:facebook",
"geoip:fastly",
"geoip:google",
"geoip:netflix",
"geoip:telegram",
"geoip:twitter"
],
"domain": [
"geosite:gfw",
"geosite:greatfire",
"geosite:tld-!cn"
"geosite:geolocation-!cn",
"geosite:greatfire"
]
},
{

View File

@ -15,7 +15,8 @@
{
"outboundTag": "direct",
"domain": [
"geosite:cn"
"geosite:cn",
"geosite:geolocation-cn"
]
},
{

View File

@ -7,7 +7,8 @@
{
"address": "223.5.5.5",
"domains": [
"geosite:cn"
"geosite:cn",
"geosite:geolocation-cn"
],
"expectIPs": [
"geoip:cn"