mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-01 20:58:50 +00:00
Add default fingerprint settings
This commit is contained in:
parent
61f297215d
commit
d2bef312ce
10 changed files with 44 additions and 8 deletions
|
@ -105,7 +105,7 @@
|
||||||
public static readonly List<string> Protocols = new List<string> { "http", "tls", "bittorrent" };
|
public static readonly List<string> Protocols = new List<string> { "http", "tls", "bittorrent" };
|
||||||
public static readonly List<string> TunMtus = new List<string> { "9000", "1500" };
|
public static readonly List<string> TunMtus = new List<string> { "9000", "1500" };
|
||||||
public static readonly List<string> TunStacks = new List<string> { "gvisor", "system" };
|
public static readonly List<string> TunStacks = new List<string> { "gvisor", "system" };
|
||||||
public static readonly List<string> PresetMsgFilters = new List<string> { "^(?!.*proxy).*$", "^(?!.*direct).*$" };
|
public static readonly List<string> PresetMsgFilters = new List<string> { "^(?!.*proxy).*$", "^(?!.*direct).*$", "" };
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -556,7 +556,7 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
|
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
|
||||||
alpn = node.GetAlpn(),
|
alpn = node.GetAlpn(),
|
||||||
fingerprint = node.fingerprint
|
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.defFingerprint : node.fingerprint
|
||||||
};
|
};
|
||||||
if (!string.IsNullOrWhiteSpace(sni))
|
if (!string.IsNullOrWhiteSpace(sni))
|
||||||
{
|
{
|
||||||
|
@ -578,7 +578,7 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
|
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
|
||||||
alpn = node.GetAlpn(),
|
alpn = node.GetAlpn(),
|
||||||
fingerprint = node.fingerprint
|
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.defFingerprint : node.fingerprint
|
||||||
};
|
};
|
||||||
if (!string.IsNullOrWhiteSpace(sni))
|
if (!string.IsNullOrWhiteSpace(sni))
|
||||||
{
|
{
|
||||||
|
|
|
@ -90,10 +90,9 @@
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否允许不安全连接
|
/// 是否允许不安全连接
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool defAllowInsecure
|
public bool defAllowInsecure { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
public string defFingerprint { get; set; }
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 域名解析策略
|
/// 域名解析策略
|
||||||
|
|
9
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
9
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
|
@ -2401,6 +2401,15 @@ namespace v2rayN.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Default TLS fingerprint 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbSettingsDefFingerprint {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbSettingsDefFingerprint", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Outbound Freedom domainStrategy 的本地化字符串。
|
/// 查找类似 Outbound Freedom domainStrategy 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1084,4 +1084,7 @@
|
||||||
<data name="SpeedtestingCompleted" xml:space="preserve">
|
<data name="SpeedtestingCompleted" xml:space="preserve">
|
||||||
<value>Test completed</value>
|
<value>Test completed</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsDefFingerprint" xml:space="preserve">
|
||||||
|
<value>Default TLS fingerprint</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1084,4 +1084,7 @@
|
||||||
<data name="SpeedtestingCompleted" xml:space="preserve">
|
<data name="SpeedtestingCompleted" xml:space="preserve">
|
||||||
<value>测试完成</value>
|
<value>测试完成</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsDefFingerprint" xml:space="preserve">
|
||||||
|
<value>默认TLS指纹(fingerprint)</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -28,6 +28,7 @@ namespace v2rayN.ViewModels
|
||||||
[Reactive] public bool logEnabled { get; set; }
|
[Reactive] public bool logEnabled { get; set; }
|
||||||
[Reactive] public string loglevel { get; set; }
|
[Reactive] public string loglevel { get; set; }
|
||||||
[Reactive] public bool defAllowInsecure { get; set; }
|
[Reactive] public bool defAllowInsecure { get; set; }
|
||||||
|
[Reactive] public string defFingerprint { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Core DNS
|
#region Core DNS
|
||||||
|
@ -110,6 +111,7 @@ namespace v2rayN.ViewModels
|
||||||
logEnabled = _config.logEnabled;
|
logEnabled = _config.logEnabled;
|
||||||
loglevel = _config.loglevel;
|
loglevel = _config.loglevel;
|
||||||
defAllowInsecure = _config.defAllowInsecure;
|
defAllowInsecure = _config.defAllowInsecure;
|
||||||
|
defFingerprint = _config.defFingerprint;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Core DNS
|
#region Core DNS
|
||||||
|
@ -269,6 +271,7 @@ namespace v2rayN.ViewModels
|
||||||
_config.loglevel = loglevel;
|
_config.loglevel = loglevel;
|
||||||
_config.muxEnabled = muxEnabled;
|
_config.muxEnabled = muxEnabled;
|
||||||
_config.defAllowInsecure = defAllowInsecure;
|
_config.defAllowInsecure = defAllowInsecure;
|
||||||
|
_config.defFingerprint = defFingerprint;
|
||||||
|
|
||||||
|
|
||||||
//DNS
|
//DNS
|
||||||
|
|
|
@ -16,7 +16,6 @@ namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
cmbMsgFilter.Items.Add(it);
|
cmbMsgFilter.Items.Add(it);
|
||||||
});
|
});
|
||||||
cmbMsgFilter.Items.Add(string.Empty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DelegateAppendText(string msg)
|
void DelegateAppendText(string msg)
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
|
@ -235,6 +236,20 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="{StaticResource SettingItemMargin}"
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="12"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsDefFingerprint}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbdefFingerprint"
|
||||||
|
Grid.Row="12"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="{StaticResource SettingItemMargin}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,10 @@ namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
cmbloglevel.Items.Add(it);
|
cmbloglevel.Items.Add(it);
|
||||||
});
|
});
|
||||||
|
Global.fingerprints.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbdefFingerprint.Items.Add(it);
|
||||||
|
});
|
||||||
Global.domainStrategy4Freedoms.ForEach(it =>
|
Global.domainStrategy4Freedoms.ForEach(it =>
|
||||||
{
|
{
|
||||||
cmbdomainStrategy4Freedom.Items.Add(it);
|
cmbdomainStrategy4Freedom.Items.Add(it);
|
||||||
|
@ -63,6 +67,7 @@ namespace v2rayN.Views
|
||||||
this.Bind(ViewModel, vm => vm.logEnabled, v => v.toglogEnabled.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.logEnabled, v => v.toglogEnabled.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.loglevel, v => v.cmbloglevel.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.loglevel, v => v.cmbloglevel.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.defAllowInsecure, v => v.togdefAllowInsecure.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.defAllowInsecure, v => v.togdefAllowInsecure.IsChecked).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.defFingerprint, v => v.cmbdefFingerprint.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.domainStrategy4Freedom, v => v.cmbdomainStrategy4Freedom.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.domainStrategy4Freedom, v => v.cmbdomainStrategy4Freedom.Text).DisposeWith(disposables);
|
||||||
|
|
Loading…
Reference in a new issue