mirror of https://github.com/2dust/v2rayN
Add clash_mode to rule
parent
4e9dfe5478
commit
72fecb2b9a
|
@ -903,6 +903,17 @@ namespace v2rayN.Handler.CoreConfig
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
singboxConfig.route.rules.Insert(0, new()
|
||||||
|
{
|
||||||
|
outbound = Global.DirectTag,
|
||||||
|
clash_mode = ERuleMode.Direct.ToString()
|
||||||
|
});
|
||||||
|
singboxConfig.route.rules.Insert(0, new()
|
||||||
|
{
|
||||||
|
outbound = Global.ProxyTag,
|
||||||
|
clash_mode = ERuleMode.Global.ToString()
|
||||||
|
});
|
||||||
|
|
||||||
if (_config.tunModeItem.enableTun)
|
if (_config.tunModeItem.enableTun)
|
||||||
{
|
{
|
||||||
singboxConfig.route.auto_detect_interface = true;
|
singboxConfig.route.auto_detect_interface = true;
|
||||||
|
@ -1192,6 +1203,16 @@ namespace v2rayN.Handler.CoreConfig
|
||||||
detour = Global.DirectTag,
|
detour = Global.DirectTag,
|
||||||
strategy = Utils.IsNullOrEmpty(strategy) ? null : strategy,
|
strategy = Utils.IsNullOrEmpty(strategy) ? null : strategy,
|
||||||
});
|
});
|
||||||
|
dns4Sbox.rules.Insert(0, new()
|
||||||
|
{
|
||||||
|
server = tag,
|
||||||
|
clash_mode = ERuleMode.Direct.ToString()
|
||||||
|
});
|
||||||
|
dns4Sbox.rules.Insert(0, new()
|
||||||
|
{
|
||||||
|
server = dns4Sbox.servers.Where(t => t.detour == Global.ProxyTag).Select(t => t.tag).FirstOrDefault() ?? "remote",
|
||||||
|
clash_mode = ERuleMode.Global.ToString()
|
||||||
|
});
|
||||||
|
|
||||||
var lstDomain = singboxConfig.outbounds
|
var lstDomain = singboxConfig.outbounds
|
||||||
.Where(t => !Utils.IsNullOrEmpty(t.server) && Utils.IsDomain(t.server))
|
.Where(t => !Utils.IsNullOrEmpty(t.server) && Utils.IsDomain(t.server))
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
public bool? ip_is_private { get; set; }
|
public bool? ip_is_private { get; set; }
|
||||||
public string? client_subnet { get; set; }
|
public string? client_subnet { get; set; }
|
||||||
public bool? invert { get; set; }
|
public bool? invert { get; set; }
|
||||||
|
public string? clash_mode { get; set; }
|
||||||
public List<string>? inbound { get; set; }
|
public List<string>? inbound { get; set; }
|
||||||
public List<string>? protocol { get; set; }
|
public List<string>? protocol { get; set; }
|
||||||
public List<string>? network { get; set; }
|
public List<string>? network { get; set; }
|
||||||
|
|
Loading…
Reference in New Issue