mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 21:23:04 +00:00
Fix chain
This commit is contained in:
parent
a89471da92
commit
3768e0d989
2 changed files with 48 additions and 25 deletions
|
|
@ -604,6 +604,15 @@ public partial class CoreConfigSingboxService
|
|||
if (i != 0)
|
||||
{
|
||||
var chainStartNodes = childProfiles.Where(n => n.tag.StartsWith(currentTag)).ToList();
|
||||
if (chainStartNodes.Count == 1)
|
||||
{
|
||||
foreach (var existedChainEndNode in resultOutbounds.Where(n => n.detour == currentTag))
|
||||
{
|
||||
existedChainEndNode.detour = chainStartNodes.First().tag;
|
||||
}
|
||||
}
|
||||
else if (chainStartNodes.Count > 1)
|
||||
{
|
||||
var existedChainNodes = JsonUtils.DeepCopy(resultOutbounds);
|
||||
resultOutbounds.Clear();
|
||||
foreach (var chainStartNode in chainStartNodes)
|
||||
|
|
@ -622,6 +631,7 @@ public partial class CoreConfigSingboxService
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resultOutbounds.AddRange(childProfiles);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -743,6 +743,18 @@ public partial class CoreConfigV2rayService
|
|||
if (i != 0)
|
||||
{
|
||||
var chainStartNodes = childProfiles.Where(n => n.tag.StartsWith(currentTag)).ToList();
|
||||
if (chainStartNodes.Count == 1)
|
||||
{
|
||||
foreach (var existedChainEndNode in resultOutbounds.Where(n => n.streamSettings?.sockopt?.dialerProxy == currentTag))
|
||||
{
|
||||
existedChainEndNode.streamSettings.sockopt = new()
|
||||
{
|
||||
dialerProxy = chainStartNodes.First().tag
|
||||
};
|
||||
}
|
||||
}
|
||||
else if (chainStartNodes.Count > 1)
|
||||
{
|
||||
var existedChainNodes = JsonUtils.DeepCopy(resultOutbounds);
|
||||
resultOutbounds.Clear();
|
||||
foreach (var chainStartNode in chainStartNodes)
|
||||
|
|
@ -762,6 +774,7 @@ public partial class CoreConfigV2rayService
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resultOutbounds.AddRange(childProfiles);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue