up vless 3

pull/936/head
2dust 2020-08-08 13:43:26 +08:00
parent 45738a7160
commit 57299cf182
6 changed files with 23 additions and 8 deletions

View File

@ -513,7 +513,7 @@ namespace v2rayN.Forms
LoadV2ray(); LoadV2ray();
} }
} }
else if (config.vmess[index].configType == (int)EConfigType.Vless) else if (config.vmess[index].configType == (int)EConfigType.VLESS)
{ {
AddServer5Form fm = new AddServer5Form AddServer5Form fm = new AddServer5Form
{ {

View File

@ -971,7 +971,7 @@ namespace v2rayN.Handler
public static int AddVlessServer(ref Config config, VmessItem vmessItem, int index) public static int AddVlessServer(ref Config config, VmessItem vmessItem, int index)
{ {
vmessItem.configVersion = 2; vmessItem.configVersion = 2;
vmessItem.configType = (int)EConfigType.Vless; vmessItem.configType = (int)EConfigType.VLESS;
vmessItem.address = vmessItem.address.TrimEx(); vmessItem.address = vmessItem.address.TrimEx();
vmessItem.id = vmessItem.id.TrimEx(); vmessItem.id = vmessItem.id.TrimEx();

View File

@ -72,7 +72,8 @@ namespace v2rayN.Handler
{ {
return; 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")); UI.Show(UIRes.I18N("NonVmessService"));
return; return;
@ -112,7 +113,8 @@ namespace v2rayN.Handler
{ {
return; 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")); UI.Show(UIRes.I18N("NonVmessService"));
return; return;

View File

@ -438,7 +438,7 @@ namespace v2rayN.Handler
outbound.protocol = Global.socksProtocolLite; outbound.protocol = Global.socksProtocolLite;
outbound.settings.vnext = null; outbound.settings.vnext = null;
} }
else if (config.configType() == (int)EConfigType.Vless) else if (config.configType() == (int)EConfigType.VLESS)
{ {
VnextItem vnextItem; VnextItem vnextItem;
if (outbound.settings.vnext.Count <= 0) if (outbound.settings.vnext.Count <= 0)
@ -466,6 +466,7 @@ namespace v2rayN.Handler
} }
//远程服务器用户ID //远程服务器用户ID
usersItem.id = config.id(); usersItem.id = config.id();
usersItem.alterId = 0;
usersItem.email = Global.userEMail; usersItem.email = Global.userEMail;
usersItem.encryption = config.security(); usersItem.encryption = config.security();
@ -888,9 +889,21 @@ namespace v2rayN.Handler
//远程服务器用户ID //远程服务器用户ID
usersItem.id = config.id(); usersItem.id = config.id();
usersItem.alterId = config.alterId();
usersItem.email = Global.userEMail; 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; StreamSettings streamSettings = inbound.streamSettings;
boundStreamSettings(config, "in", ref streamSettings); boundStreamSettings(config, "in", ref streamSettings);

View File

@ -422,7 +422,7 @@ namespace v2rayN.Mode
{ {
summary += string.Format("{0}({1}:{2})", remarks, addr, port); 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); summary += string.Format("{0}({1}:{2})", remarks, addr, port);
} }

View File

@ -7,6 +7,6 @@ namespace v2rayN.Mode
Custom = 2, Custom = 2,
Shadowsocks = 3, Shadowsocks = 3,
Socks = 4, Socks = 4,
Vless = 5 VLESS = 5
} }
} }