mirror of https://github.com/2dust/v2rayN
Add reality and remove legacy xtls settings
parent
6f181053b2
commit
045af7e8df
|
@ -43,7 +43,7 @@
|
|||
public const string directTag = "direct";
|
||||
public const string blockTag = "block";
|
||||
public const string StreamSecurity = "tls";
|
||||
public const string StreamSecurityX = "xtls";
|
||||
public const string StreamSecurityReality = "reality";
|
||||
public const string InboundSocks = "socks";
|
||||
public const string InboundHttp = "http";
|
||||
public const string InboundSocks2 = "socks2";
|
||||
|
@ -92,7 +92,7 @@
|
|||
public static readonly List<string> ssSecuritys = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
|
||||
public static readonly List<string> ssSecuritysInSagerNet = new() { "none", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "rc4", "rc4-md5", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-cfb8", "aes-192-cfb8", "aes-256-cfb8", "aes-128-ofb", "aes-192-ofb", "aes-256-ofb", "bf-cfb", "cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "camellia-128-cfb8", "camellia-192-cfb8", "camellia-256-cfb8", "salsa20", "chacha20", "chacha20-ietf", "xchacha20" };
|
||||
public static readonly List<string> ssSecuritysInXray = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" };
|
||||
public static readonly List<string> xtlsFlows = new() { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
|
||||
public static readonly List<string> flows = new() { "", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
|
||||
public static readonly List<string> networks = new() { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
|
||||
public static readonly List<string> kcpHeaderTypes = new() { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
|
||||
public static readonly List<string> coreTypes = new() { "v2fly", "SagerNet", "Xray", "v2fly_v5" };
|
||||
|
|
|
@ -456,16 +456,15 @@ namespace v2rayN.Handler
|
|||
|
||||
boundStreamSettings(node, "out", outbound.streamSettings);
|
||||
|
||||
//if xtls
|
||||
if (node.streamSecurity == Global.StreamSecurityX)
|
||||
if (node.streamSecurity == Global.StreamSecurityReality)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(node.flow))
|
||||
{
|
||||
usersItem.flow = Global.xtlsFlows[1];
|
||||
usersItem.flow = Global.flows[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
usersItem.flow = node.flow.Replace("splice", "direct");
|
||||
usersItem.flow = node.flow;
|
||||
}
|
||||
|
||||
outbound.mux.enabled = false;
|
||||
|
@ -503,23 +502,7 @@ namespace v2rayN.Handler
|
|||
serversItem.flow = string.Empty;
|
||||
|
||||
serversItem.ota = false;
|
||||
serversItem.level = 1;
|
||||
|
||||
//if xtls
|
||||
if (node.streamSecurity == Global.StreamSecurityX)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(node.flow))
|
||||
{
|
||||
serversItem.flow = Global.xtlsFlows[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
serversItem.flow = node.flow.Replace("splice", "direct");
|
||||
}
|
||||
|
||||
outbound.mux.enabled = false;
|
||||
outbound.mux.concurrency = -1;
|
||||
}
|
||||
serversItem.level = 1;
|
||||
|
||||
outbound.mux.enabled = false;
|
||||
outbound.mux.concurrency = -1;
|
||||
|
@ -581,26 +564,21 @@ namespace v2rayN.Handler
|
|||
streamSettings.tlsSettings = tlsSettings;
|
||||
}
|
||||
|
||||
//if xtls
|
||||
if (node.streamSecurity == Global.StreamSecurityX)
|
||||
//if Reality
|
||||
if (node.streamSecurity == Global.StreamSecurityReality)
|
||||
{
|
||||
streamSettings.security = node.streamSecurity;
|
||||
|
||||
TlsSettings xtlsSettings = new()
|
||||
RealitySettings realitySettings = new()
|
||||
{
|
||||
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.coreBasicItem.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
|
||||
alpn = node.GetAlpn(),
|
||||
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.coreBasicItem.defFingerprint : node.fingerprint
|
||||
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.coreBasicItem.defFingerprint : node.fingerprint,
|
||||
serverName = sni,
|
||||
publicKey = node.publicKey,
|
||||
shortId = node.shortId,
|
||||
spiderX = node.spiderX,
|
||||
};
|
||||
if (!string.IsNullOrWhiteSpace(sni))
|
||||
{
|
||||
xtlsSettings.serverName = sni;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(host))
|
||||
{
|
||||
xtlsSettings.serverName = Utils.String2List(host)[0];
|
||||
}
|
||||
streamSettings.xtlsSettings = xtlsSettings;
|
||||
|
||||
streamSettings.realitySettings = realitySettings;
|
||||
}
|
||||
|
||||
//streamSettings
|
||||
|
|
|
@ -85,158 +85,100 @@ namespace v2rayN.Mode
|
|||
#endregion
|
||||
|
||||
[PrimaryKey]
|
||||
public string indexId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string indexId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// config type(1=normal,2=custom)
|
||||
/// </summary>
|
||||
public EConfigType configType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public EConfigType configType { get; set; }
|
||||
/// <summary>
|
||||
/// 版本(现在=2)
|
||||
/// </summary>
|
||||
public int configVersion
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public int configVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 远程服务器地址
|
||||
/// </summary>
|
||||
public string address
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string address { get; set; }
|
||||
/// <summary>
|
||||
/// 远程服务器端口
|
||||
/// </summary>
|
||||
public int port
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public int port { get; set; }
|
||||
/// <summary>
|
||||
/// 远程服务器ID
|
||||
/// </summary>
|
||||
public string id
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string id { get; set; }
|
||||
/// <summary>
|
||||
/// 远程服务器额外ID
|
||||
/// </summary>
|
||||
public int alterId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public int alterId { get; set; }
|
||||
/// <summary>
|
||||
/// 本地安全策略
|
||||
/// </summary>
|
||||
public string security
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string security { get; set; }
|
||||
/// <summary>
|
||||
/// tcp,kcp,ws,h2,quic
|
||||
/// </summary>
|
||||
public string network
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string network { get; set; }
|
||||
/// <summary>
|
||||
/// 备注或别名
|
||||
/// </summary>
|
||||
public string remarks
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 伪装类型
|
||||
/// </summary>
|
||||
public string headerType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string headerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 伪装的域名
|
||||
/// </summary>
|
||||
public string requestHost
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string requestHost { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ws h2 path
|
||||
/// </summary>
|
||||
public string path
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 传输层安全
|
||||
/// </summary>
|
||||
public string streamSecurity
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string streamSecurity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否允许不安全连接(用于客户端)
|
||||
/// </summary>
|
||||
public string allowInsecure
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string allowInsecure { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SubItem id
|
||||
/// </summary>
|
||||
public string subid
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string subid { get; set; }
|
||||
public bool isSub { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// VLESS flow
|
||||
/// </summary>
|
||||
public string flow
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string flow { get; set; }
|
||||
/// <summary>
|
||||
/// tls sni
|
||||
/// </summary>
|
||||
public string sni
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string sni { get; set; }
|
||||
/// <summary>
|
||||
/// tls alpn
|
||||
/// </summary>
|
||||
public string alpn { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public ECoreType? coreType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public ECoreType? coreType { get; set; }
|
||||
|
||||
public int preSocksPort
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public int preSocksPort { get; set; }
|
||||
|
||||
public string fingerprint { get; set; }
|
||||
|
||||
public bool displayLog { get; set; } = true;
|
||||
public string publicKey { get; set; }
|
||||
public string shortId { get; set; }
|
||||
public string spiderX { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -389,9 +389,9 @@ namespace v2rayN.Mode
|
|||
public QuicSettings quicSettings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// VLESS xtls
|
||||
/// VLESS only
|
||||
/// </summary>
|
||||
public TlsSettings xtlsSettings { get; set; }
|
||||
public RealitySettings realitySettings { get; set; }
|
||||
/// <summary>
|
||||
/// grpc
|
||||
/// </summary>
|
||||
|
@ -424,6 +424,15 @@ namespace v2rayN.Mode
|
|||
public string fingerprint { get; set; }
|
||||
|
||||
}
|
||||
public class RealitySettings
|
||||
{
|
||||
public bool show { get; set; } = false;
|
||||
public string fingerprint { get; set; }
|
||||
public string serverName { get; set; }
|
||||
public string publicKey { get; set; }
|
||||
public string shortId { get; set; }
|
||||
public string spiderX { get; set; }
|
||||
}
|
||||
|
||||
public class TcpSettings
|
||||
{
|
||||
|
|
|
@ -2167,6 +2167,15 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 PublicKey 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbPublicKey {
|
||||
get {
|
||||
return ResourceManager.GetString("TbPublicKey", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Alias (remarks) 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -2896,6 +2905,15 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 ShortId 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbShortId {
|
||||
get {
|
||||
return ResourceManager.GetString("TbShortId", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 SNI 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -2905,6 +2923,15 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 SpiderX 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbSpiderX {
|
||||
get {
|
||||
return ResourceManager.GetString("TbSpiderX", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 TLS 的本地化字符串。
|
||||
/// </summary>
|
||||
|
|
|
@ -1132,4 +1132,13 @@
|
|||
<data name="menuMoveTo" xml:space="preserve">
|
||||
<value>Move up and down</value>
|
||||
</data>
|
||||
<data name="TbPublicKey" xml:space="preserve">
|
||||
<value>PublicKey</value>
|
||||
</data>
|
||||
<data name="TbShortId" xml:space="preserve">
|
||||
<value>ShortId</value>
|
||||
</data>
|
||||
<data name="TbSpiderX" xml:space="preserve">
|
||||
<value>SpiderX</value>
|
||||
</data>
|
||||
</root>
|
|
@ -710,7 +710,7 @@
|
|||
<value>SNI</value>
|
||||
</data>
|
||||
<data name="TbStreamSecurity" xml:space="preserve">
|
||||
<value>TLS</value>
|
||||
<value>传输层安全(TLS)</value>
|
||||
</data>
|
||||
<data name="TipNetwork" xml:space="preserve">
|
||||
<value>*默认tcp,选错会无法连接</value>
|
||||
|
@ -1132,4 +1132,13 @@
|
|||
<data name="menuMoveTo" xml:space="preserve">
|
||||
<value>移至上下</value>
|
||||
</data>
|
||||
<data name="TbPublicKey" xml:space="preserve">
|
||||
<value>PublicKey</value>
|
||||
</data>
|
||||
<data name="TbShortId" xml:space="preserve">
|
||||
<value>ShortId</value>
|
||||
</data>
|
||||
<data name="TbSpiderX" xml:space="preserve">
|
||||
<value>SpiderX</value>
|
||||
</data>
|
||||
</root>
|
|
@ -118,6 +118,10 @@ namespace v2rayN.ViewModels
|
|||
item.allowInsecure = SelectedSource.allowInsecure;
|
||||
item.fingerprint = SelectedSource.fingerprint;
|
||||
item.alpn = SelectedSource.alpn;
|
||||
|
||||
item.publicKey = SelectedSource.publicKey;
|
||||
item.shortId = SelectedSource.shortId;
|
||||
item.spiderX = SelectedSource.spiderX;
|
||||
}
|
||||
|
||||
int ret = -1;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
Title="{x:Static resx:ResUI.menuServers}"
|
||||
Width="800"
|
||||
Height="800"
|
||||
Height="830"
|
||||
x:TypeArguments="vms:AddServerViewModel"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||
|
@ -559,8 +559,10 @@
|
|||
Margin="{StaticResource ServerItemMargin}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
</Grid>
|
||||
|
||||
<Grid x:Name="gridTlsMore" Grid.Row="7">
|
||||
<Grid
|
||||
x:Name="gridTlsMore"
|
||||
Grid.Row="7"
|
||||
Visibility="Hidden">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -595,25 +597,10 @@
|
|||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
||||
<ComboBox
|
||||
x:Name="cmbAllowInsecure"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="100"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbFingerprint}" />
|
||||
<ComboBox
|
||||
x:Name="cmbFingerprint"
|
||||
Grid.Row="3"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
|
@ -621,7 +608,7 @@
|
|||
Style="{StaticResource DefComboBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
|
@ -629,13 +616,125 @@
|
|||
Text="{x:Static resx:ResUI.TbAlpn}" />
|
||||
<ComboBox
|
||||
x:Name="cmbAlpn"
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
||||
<ComboBox
|
||||
x:Name="cmbAllowInsecure"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Width="100"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="gridRealityMore"
|
||||
Grid.Row="7"
|
||||
Visibility="Hidden">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSNI}" />
|
||||
<TextBox
|
||||
x:Name="txtSNI2"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbFingerprint}" />
|
||||
<ComboBox
|
||||
x:Name="cmbFingerprint2"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
IsEditable="True"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbPublicKey}" />
|
||||
<TextBox
|
||||
x:Name="txtPublicKey"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbShortId}" />
|
||||
<TextBox
|
||||
x:Name="txtShortId"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSpiderX}" />
|
||||
<TextBox
|
||||
x:Name="txtSpiderX"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource ServerItemMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
|
||||
</Grid>
|
||||
<Separator
|
||||
Grid.Row="8"
|
||||
Margin="0,2"
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace v2rayN.Views
|
|||
Global.fingerprints.ForEach(it =>
|
||||
{
|
||||
cmbFingerprint.Items.Add(it);
|
||||
cmbFingerprint2.Items.Add(it);
|
||||
});
|
||||
Global.allowInsecures.ForEach(it =>
|
||||
{
|
||||
|
@ -74,8 +75,8 @@ namespace v2rayN.Views
|
|||
break;
|
||||
case EConfigType.VLESS:
|
||||
gridVLESS.Visibility = Visibility.Visible;
|
||||
cmbStreamSecurity.Items.Add(Global.StreamSecurityX);
|
||||
Global.xtlsFlows.ForEach(it =>
|
||||
cmbStreamSecurity.Items.Add(Global.StreamSecurityReality);
|
||||
Global.flows.ForEach(it =>
|
||||
{
|
||||
cmbFlow5.Items.Add(it);
|
||||
});
|
||||
|
@ -86,8 +87,7 @@ namespace v2rayN.Views
|
|||
break;
|
||||
case EConfigType.Trojan:
|
||||
gridTrojan.Visibility = Visibility.Visible;
|
||||
cmbStreamSecurity.Items.Add(Global.StreamSecurityX);
|
||||
Global.xtlsFlows.ForEach(it =>
|
||||
Global.flows.ForEach(it =>
|
||||
{
|
||||
cmbFlow6.Items.Add(it);
|
||||
});
|
||||
|
@ -138,6 +138,13 @@ namespace v2rayN.Views
|
|||
this.Bind(ViewModel, vm => vm.SelectedSource.allowInsecure, v => v.cmbAllowInsecure.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.fingerprint, v => v.cmbFingerprint.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.alpn, v => v.cmbAlpn.Text).DisposeWith(disposables);
|
||||
//reality
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.sni, v => v.txtSNI2.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.fingerprint, v => v.cmbFingerprint2.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.publicKey, v => v.txtPublicKey.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.shortId, v => v.txtShortId.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.spiderX, v => v.txtSpiderX.Text).DisposeWith(disposables);
|
||||
|
||||
|
||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||
|
||||
|
@ -159,13 +166,20 @@ namespace v2rayN.Views
|
|||
private void CmbStreamSecurity_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
var security = cmbStreamSecurity.SelectedItem.ToString();
|
||||
if (Utils.IsNullOrEmpty(security))
|
||||
if (security == Global.StreamSecurityReality)
|
||||
{
|
||||
gridRealityMore.Visibility = Visibility.Visible;
|
||||
gridTlsMore.Visibility = Visibility.Hidden;
|
||||
}
|
||||
else if (security == Global.StreamSecurity)
|
||||
{
|
||||
gridRealityMore.Visibility = Visibility.Hidden;
|
||||
gridTlsMore.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
gridTlsMore.Visibility = Visibility.Visible;
|
||||
gridRealityMore.Visibility = Visibility.Hidden;
|
||||
gridTlsMore.Visibility = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
private void btnGUID_Click(object sender, RoutedEventArgs e)
|
||||
|
|
Loading…
Reference in New Issue