mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 05:03:02 +00:00
Compare commits
3 commits
2308f63da8
...
1e8f9ce2cd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e8f9ce2cd | ||
|
|
3a5293bf87 | ||
|
|
ac43bb051d |
17 changed files with 25 additions and 57 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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ public class Hysteria2Fmt : BaseFmt
|
||||||
if (!item.CertSha.IsNullOrEmpty())
|
if (!item.CertSha.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
var sha = item.CertSha;
|
var sha = item.CertSha;
|
||||||
var idx = sha.IndexOf('~');
|
var idx = sha.IndexOf(',');
|
||||||
if (idx > 0)
|
if (idx > 0)
|
||||||
{
|
{
|
||||||
sha = sha[..idx];
|
sha = sha[..idx];
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
9
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
9
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
|
|
@ -3798,15 +3798,6 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 which conflicts with the group previous proxy 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsEnableFragmentTips {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSettingsEnableFragmentTips", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Enable hardware acceleration (requires restart) 的本地化字符串。
|
/// 查找类似 Enable hardware acceleration (requires restart) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1113,9 +1113,6 @@
|
||||||
<data name="menuAddHttpServer" xml:space="preserve">
|
<data name="menuAddHttpServer" xml:space="preserve">
|
||||||
<value>افزودن سرور [HTTP]</value>
|
<value>افزودن سرور [HTTP]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
|
|
||||||
<value>which conflicts with the group previous proxy</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
||||||
<value>فعال کردن فرگمنت</value>
|
<value>فعال کردن فرگمنت</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1110,9 +1110,6 @@
|
||||||
<data name="menuAddHttpServer" xml:space="preserve">
|
<data name="menuAddHttpServer" xml:space="preserve">
|
||||||
<value>Ajouter [HTTP]</value>
|
<value>Ajouter [HTTP]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
|
|
||||||
<value>En conflit avec le proxy amont de groupe</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
||||||
<value>Activer le fragmentation (Fragment)</value>
|
<value>Activer le fragmentation (Fragment)</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1113,9 +1113,6 @@
|
||||||
<data name="menuAddHttpServer" xml:space="preserve">
|
<data name="menuAddHttpServer" xml:space="preserve">
|
||||||
<value>HTTP konfiguráció hozzáadása</value>
|
<value>HTTP konfiguráció hozzáadása</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
|
|
||||||
<value>which conflicts with the group previous proxy</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
||||||
<value>Fragment engedélyezése</value>
|
<value>Fragment engedélyezése</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1113,9 +1113,6 @@
|
||||||
<data name="menuAddHttpServer" xml:space="preserve">
|
<data name="menuAddHttpServer" xml:space="preserve">
|
||||||
<value>Add [HTTP]</value>
|
<value>Add [HTTP]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
|
|
||||||
<value>which conflicts with the group previous proxy</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
||||||
<value>Enable fragment</value>
|
<value>Enable fragment</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1113,9 +1113,6 @@
|
||||||
<data name="menuAddHttpServer" xml:space="preserve">
|
<data name="menuAddHttpServer" xml:space="preserve">
|
||||||
<value>Добавить сервер [HTTP]</value>
|
<value>Добавить сервер [HTTP]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
|
|
||||||
<value>что конфликтует с предыдущим прокси группы</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
||||||
<value>Включить фрагментацию (Fragment)</value>
|
<value>Включить фрагментацию (Fragment)</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1110,9 +1110,6 @@
|
||||||
<data name="menuAddHttpServer" xml:space="preserve">
|
<data name="menuAddHttpServer" xml:space="preserve">
|
||||||
<value>添加 [HTTP] </value>
|
<value>添加 [HTTP] </value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
|
|
||||||
<value>和分组前置代理冲突</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
||||||
<value>启用分片 (Fragment)</value>
|
<value>启用分片 (Fragment)</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1110,9 +1110,6 @@
|
||||||
<data name="menuAddHttpServer" xml:space="preserve">
|
<data name="menuAddHttpServer" xml:space="preserve">
|
||||||
<value>新增 [HTTP] 節點</value>
|
<value>新增 [HTTP] 節點</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
|
|
||||||
<value>和分組前置代理衝突</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
<data name="TbSettingsEnableFragment" xml:space="preserve">
|
||||||
<value>啟用分片(Fragment)</value>
|
<value>啟用分片(Fragment)</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public partial class CoreConfigV2rayService
|
||||||
var fragmentOutbound = new Outbounds4Ray
|
var fragmentOutbound = new Outbounds4Ray
|
||||||
{
|
{
|
||||||
protocol = "freedom",
|
protocol = "freedom",
|
||||||
tag = $"frag-{Global.ProxyTag}",
|
tag = $"frag-{baseTagName}",
|
||||||
settings = new()
|
settings = new()
|
||||||
{
|
{
|
||||||
fragment = new()
|
fragment = new()
|
||||||
|
|
@ -44,16 +44,17 @@ public partial class CoreConfigV2rayService
|
||||||
};
|
};
|
||||||
var actOutboundWithTlsList =
|
var actOutboundWithTlsList =
|
||||||
proxyOutboundList.Where(n => n.streamSettings?.security.IsNullOrEmpty() == false
|
proxyOutboundList.Where(n => n.streamSettings?.security.IsNullOrEmpty() == false
|
||||||
&& (n.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true));
|
&& (n.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true)).ToList();
|
||||||
|
if (actOutboundWithTlsList.Count > 0)
|
||||||
|
{
|
||||||
|
proxyOutboundList.Add(fragmentOutbound);
|
||||||
|
}
|
||||||
foreach (var outbound in actOutboundWithTlsList)
|
foreach (var outbound in actOutboundWithTlsList)
|
||||||
{
|
{
|
||||||
var fragmentOutboundClone = JsonUtils.DeepCopy(fragmentOutbound);
|
|
||||||
fragmentOutboundClone.tag = $"frag-{outbound.tag}";
|
|
||||||
outbound.streamSettings.sockopt = new()
|
outbound.streamSettings.sockopt = new()
|
||||||
{
|
{
|
||||||
dialerProxy = fragmentOutboundClone.tag
|
dialerProxy = fragmentOutbound.tag
|
||||||
};
|
};
|
||||||
proxyOutboundList.Add(fragmentOutboundClone);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return proxyOutboundList;
|
return proxyOutboundList;
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ public class AddServerViewModel : MyReactiveObject
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> shaList = new();
|
List<string> shaList = [];
|
||||||
foreach (var cert in certList)
|
foreach (var cert in certList)
|
||||||
{
|
{
|
||||||
var sha = CertPemManager.GetCertSha256Thumbprint(cert);
|
var sha = CertPemManager.GetCertSha256Thumbprint(cert);
|
||||||
|
|
@ -228,7 +228,7 @@ public class AddServerViewModel : MyReactiveObject
|
||||||
}
|
}
|
||||||
shaList.Add(sha);
|
shaList.Add(sha);
|
||||||
}
|
}
|
||||||
CertSha = string.Join('~', shaList);
|
CertSha = string.Join(',', shaList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task FetchCert()
|
private async Task FetchCert()
|
||||||
|
|
|
||||||
|
|
@ -325,12 +325,6 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
<TextBlock
|
|
||||||
Grid.Row="20"
|
|
||||||
Grid.Column="2"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
|
||||||
|
|
@ -391,13 +391,6 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
<TextBlock
|
|
||||||
Grid.Row="20"
|
|
||||||
Grid.Column="2"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue