diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index be5fe009..bfbbc40f 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -513,7 +513,7 @@ namespace v2rayN.Forms LoadV2ray(); } } - else if (config.vmess[index].configType == (int)EConfigType.Vless) + else if (config.vmess[index].configType == (int)EConfigType.VLESS) { AddServer5Form fm = new AddServer5Form { diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index aeb94abb..d8a1a7f0 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -971,7 +971,7 @@ namespace v2rayN.Handler public static int AddVlessServer(ref Config config, VmessItem vmessItem, int index) { vmessItem.configVersion = 2; - vmessItem.configType = (int)EConfigType.Vless; + vmessItem.configType = (int)EConfigType.VLESS; vmessItem.address = vmessItem.address.TrimEx(); vmessItem.id = vmessItem.id.TrimEx(); diff --git a/v2rayN/v2rayN/Handler/MainFormHandler.cs b/v2rayN/v2rayN/Handler/MainFormHandler.cs index 83865d92..419ba374 100644 --- a/v2rayN/v2rayN/Handler/MainFormHandler.cs +++ b/v2rayN/v2rayN/Handler/MainFormHandler.cs @@ -72,7 +72,8 @@ namespace v2rayN.Handler { return; } - if (config.vmess[index].configType != (int)EConfigType.Vmess) + if (config.vmess[index].configType != (int)EConfigType.Vmess + && config.vmess[index].configType != (int)EConfigType.VLESS) { UI.Show(UIRes.I18N("NonVmessService")); return; @@ -112,7 +113,8 @@ namespace v2rayN.Handler { return; } - if (config.vmess[index].configType != (int)EConfigType.Vmess) + if (config.vmess[index].configType != (int)EConfigType.Vmess + && config.vmess[index].configType != (int)EConfigType.VLESS) { UI.Show(UIRes.I18N("NonVmessService")); return; diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 888fe0b5..535cb887 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -438,7 +438,7 @@ namespace v2rayN.Handler outbound.protocol = Global.socksProtocolLite; outbound.settings.vnext = null; } - else if (config.configType() == (int)EConfigType.Vless) + else if (config.configType() == (int)EConfigType.VLESS) { VnextItem vnextItem; if (outbound.settings.vnext.Count <= 0) @@ -466,6 +466,7 @@ namespace v2rayN.Handler } //远程服务器用户ID usersItem.id = config.id(); + usersItem.alterId = 0; usersItem.email = Global.userEMail; usersItem.encryption = config.security(); @@ -888,9 +889,21 @@ namespace v2rayN.Handler //远程服务器用户ID usersItem.id = config.id(); - usersItem.alterId = config.alterId(); usersItem.email = Global.userEMail; + if (config.configType() == (int)EConfigType.Vmess) + { + inbound.protocol = Global.vmessProtocolLite; + usersItem.alterId = config.alterId(); + + } + else if (config.configType() == (int)EConfigType.VLESS) + { + inbound.protocol = Global.vlessProtocolLite; + usersItem.alterId = 0; + inbound.settings.decryption = config.security(); + } + //远程服务器底层传输配置 StreamSettings streamSettings = inbound.streamSettings; boundStreamSettings(config, "in", ref streamSettings); diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index 8c656a3e..d2450fd2 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -422,7 +422,7 @@ namespace v2rayN.Mode { summary += string.Format("{0}({1}:{2})", remarks, addr, port); } - if (configType == (int)EConfigType.Vless) + if (configType == (int)EConfigType.VLESS) { summary += string.Format("{0}({1}:{2})", remarks, addr, port); } diff --git a/v2rayN/v2rayN/Mode/EConfigType.cs b/v2rayN/v2rayN/Mode/EConfigType.cs index 2d7ab219..13381ea5 100644 --- a/v2rayN/v2rayN/Mode/EConfigType.cs +++ b/v2rayN/v2rayN/Mode/EConfigType.cs @@ -7,6 +7,6 @@ namespace v2rayN.Mode Custom = 2, Shadowsocks = 3, Socks = 4, - Vless = 5 + VLESS = 5 } }