mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 13:13:04 +00:00
Node test with sub chain
This commit is contained in:
parent
a03e38fb16
commit
f7409053cd
4 changed files with 15 additions and 5 deletions
|
|
@ -99,7 +99,12 @@ public static class CoreConfigHandler
|
||||||
var nodes = await AppManager.Instance.GetProfileItemsByIndexIds(ids);
|
var nodes = await AppManager.Instance.GetProfileItemsByIndexIds(ids);
|
||||||
foreach (var node in nodes)
|
foreach (var node in nodes)
|
||||||
{
|
{
|
||||||
await FillNodeContext(context, node, false);
|
var actNode = await FillNodeContext(context, node, true);
|
||||||
|
if (node.IndexId == actNode.IndexId)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
context.ServerTestItemMap[node.IndexId] = actNode.IndexId;
|
||||||
}
|
}
|
||||||
if (coreType == ECoreType.sing_box)
|
if (coreType == ECoreType.sing_box)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ public record CoreConfigContext
|
||||||
public Config AppConfig { get; init; } = new();
|
public Config AppConfig { get; init; } = new();
|
||||||
public FullConfigTemplateItem? FullConfigTemplate { get; init; } = new();
|
public FullConfigTemplateItem? FullConfigTemplate { get; init; } = new();
|
||||||
|
|
||||||
|
// Test ServerTestItem Map
|
||||||
|
public Dictionary<string, string> ServerTestItemMap { get; init; } = new();
|
||||||
|
|
||||||
// TUN Compatibility
|
// TUN Compatibility
|
||||||
public bool IsTunEnabled { get; init; } = false;
|
public bool IsTunEnabled { get; init; } = false;
|
||||||
public HashSet<string> ProtectDomainList { get; init; } = new();
|
public HashSet<string> ProtectDomainList { get; init; } = new();
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,9 @@ public partial class CoreConfigSingboxService(CoreConfigContext context)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var item = context.AllProxiesMap.GetValueOrDefault(it.IndexId);
|
var actIndexId = context.ServerTestItemMap.GetValueOrDefault(it.IndexId, it.IndexId);
|
||||||
if (item is null || item.IsComplex() || !item.IsValid())
|
var item = context.AllProxiesMap.GetValueOrDefault(actIndexId);
|
||||||
|
if (item is null || item.ConfigType is EConfigType.Custom || !item.IsValid())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,9 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var item = context.AllProxiesMap.GetValueOrDefault(it.IndexId);
|
var actIndexId = context.ServerTestItemMap.GetValueOrDefault(it.IndexId, it.IndexId);
|
||||||
if (item is null || item.IsComplex() || !item.IsValid())
|
var item = context.AllProxiesMap.GetValueOrDefault(actIndexId);
|
||||||
|
if (item is null || item.ConfigType is EConfigType.Custom || !item.IsValid())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue