diff --git a/v2rayN/v2rayN/Forms/AddServer4Form.Designer.cs b/v2rayN/v2rayN/Forms/AddServer4Form.Designer.cs
index fb950a5c..3ae98f0b 100644
--- a/v2rayN/v2rayN/Forms/AddServer4Form.Designer.cs
+++ b/v2rayN/v2rayN/Forms/AddServer4Form.Designer.cs
@@ -31,6 +31,10 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddServer4Form));
this.btnClose = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.txtSecurity = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.txtId = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
@@ -51,15 +55,18 @@
//
// btnClose
//
- resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// groupBox1
//
- resources.ApplyResources(this.groupBox1, "groupBox1");
+ this.groupBox1.Controls.Add(this.txtSecurity);
+ this.groupBox1.Controls.Add(this.label4);
+ this.groupBox1.Controls.Add(this.txtId);
+ this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.txtRemarks);
this.groupBox1.Controls.Add(this.label6);
@@ -67,9 +74,30 @@
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtAddress);
this.groupBox1.Controls.Add(this.label1);
+ resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
+ // txtSecurity
+ //
+ resources.ApplyResources(this.txtSecurity, "txtSecurity");
+ this.txtSecurity.Name = "txtSecurity";
+ //
+ // label4
+ //
+ resources.ApplyResources(this.label4, "label4");
+ this.label4.Name = "label4";
+ //
+ // txtId
+ //
+ resources.ApplyResources(this.txtId, "txtId");
+ this.txtId.Name = "txtId";
+ //
+ // label3
+ //
+ resources.ApplyResources(this.label3, "label3");
+ this.label3.Name = "label3";
+ //
// label13
//
resources.ApplyResources(this.label13, "label13");
@@ -107,9 +135,9 @@
//
// panel2
//
- resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
+ resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnOK
@@ -126,22 +154,22 @@
//
// menuServer
//
- resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItem1});
+ resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// MenuItem1
//
- resources.ApplyResources(this.MenuItem1, "MenuItem1");
this.MenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemImportClipboard});
this.MenuItem1.Name = "MenuItem1";
+ resources.ApplyResources(this.MenuItem1, "MenuItem1");
//
// menuItemImportClipboard
//
- resources.ApplyResources(this.menuItemImportClipboard, "menuItemImportClipboard");
this.menuItemImportClipboard.Name = "menuItemImportClipboard";
+ resources.ApplyResources(this.menuItemImportClipboard, "menuItemImportClipboard");
this.menuItemImportClipboard.Click += new System.EventHandler(this.menuItemImportClipboard_Click);
//
// AddServer4Form
@@ -184,5 +212,9 @@
private System.Windows.Forms.MenuStrip menuServer;
private System.Windows.Forms.ToolStripMenuItem MenuItem1;
private System.Windows.Forms.ToolStripMenuItem menuItemImportClipboard;
+ private System.Windows.Forms.TextBox txtId;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.TextBox txtSecurity;
+ private System.Windows.Forms.Label label4;
}
}
\ No newline at end of file
diff --git a/v2rayN/v2rayN/Forms/AddServer4Form.cs b/v2rayN/v2rayN/Forms/AddServer4Form.cs
index edb80516..d331bec2 100644
--- a/v2rayN/v2rayN/Forms/AddServer4Form.cs
+++ b/v2rayN/v2rayN/Forms/AddServer4Form.cs
@@ -36,6 +36,8 @@ namespace v2rayN.Forms
{
txtAddress.Text = vmessItem.address;
txtPort.Text = vmessItem.port.ToString();
+ txtId.Text = vmessItem.id;
+ txtSecurity.Text = vmessItem.security;
txtRemarks.Text = vmessItem.remarks;
}
@@ -47,6 +49,8 @@ namespace v2rayN.Forms
{
txtAddress.Text = "";
txtPort.Text = "";
+ txtId.Text = "";
+ txtSecurity.Text = "";
txtRemarks.Text = "";
}
@@ -54,6 +58,8 @@ namespace v2rayN.Forms
{
string address = txtAddress.Text;
string port = txtPort.Text;
+ string id = txtId.Text;
+ string security = txtSecurity.Text;
string remarks = txtRemarks.Text;
if (Utils.IsNullOrEmpty(address))
@@ -69,6 +75,8 @@ namespace v2rayN.Forms
vmessItem.address = address;
vmessItem.port = Utils.ToInt(port);
+ vmessItem.id = id;
+ vmessItem.security = security;
vmessItem.remarks = remarks;
if (ConfigHandler.AddSocksServer(ref config, vmessItem, EditIndex) == 0)
@@ -112,6 +120,8 @@ namespace v2rayN.Forms
txtAddress.Text = vmessItem.address;
txtPort.Text = vmessItem.port.ToString();
+ txtSecurity.Text = vmessItem.security;
+ txtId.Text = vmessItem.id;
txtRemarks.Text = vmessItem.remarks;
}
diff --git a/v2rayN/v2rayN/Forms/AddServer4Form.resx b/v2rayN/v2rayN/Forms/AddServer4Form.resx
index d1e34f1a..566de4b3 100644
--- a/v2rayN/v2rayN/Forms/AddServer4Form.resx
+++ b/v2rayN/v2rayN/Forms/AddServer4Form.resx
@@ -117,367 +117,472 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- txtAddress
+
+
+ 396, 17
-
- Server address
+
+ 75, 23
-
- 3
+
+ 4
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ &Cancel
+
+
+ btnClose
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ panel2
+
+
+ 0
+
+
+ 127, 84
+
+
+ 278, 21
+
+
+ 26
+
+
+ txtSecurity
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 0
+
+
+ True
-
- Bottom
+
+ NoControl
-
+
+ 12, 88
+
+
+ 89, 12
+
+
+ 25
+
+
+ User(Optional)
+
+
+ label4
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
groupBox1
+
+ 1
+
+
+ 127, 117
+
+
+ *
+
+
+ 278, 21
+
+
+ 24
+
+
+ txtId
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 2
+
+
+ True
+
+
+ NoControl
+
+
+ 12, 121
+
+
+ 113, 12
+
+
+ 23
+
+
+ Password(Optional)
+
+
+ label3
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 3
+
True
-
- menuServer
+
+ 337, 158
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 113, 12
-
- btnOK
+
+ 22
+
+
+ * Fill in manually
+
+
+ label13
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 4
+
+
+ 127, 154
+
+
+ 194, 21
+
+
+ 11
txtRemarks
-
-
- 194, 21
-
-
- System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- AddServer4Form
-
-
- 89, 12
-
-
- label1
-
System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
groupBox1
-
- panel2
-
-
- 12, 158
-
-
- System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Fill
-
-
- 194, 21
-
-
- groupBox1
-
-
- 6, 12
-
-
- 547, 25
+
+ 5
True
-
- Alias (remarks)
-
-
- 127, 154
-
-
- groupBox1
-
-
- 6
-
-
- 7
-
-
- groupBox1
-
-
- 113, 12
-
-
- MenuItem1
-
-
- Server
-
-
- 162, 21
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 0
-
-
- 2
-
-
- 547, 60
-
-
- System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Edit or add a [Socks] server
-
-
- 359, 21
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 547, 10
-
-
- * Fill in manually
-
-
- 4
-
-
- 10
-
-
- 71, 12
-
-
- 0
-
-
- panel1
-
-
- 75, 23
-
-
- 12, 60
-
-
- 1
-
-
- $this
-
-
- btnClose
-
-
- label6
-
-
- 8
-
-
- 303, 17
-
-
- 127, 27
-
-
- 75, 23
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- Top
-
-
- 0, 35
-
-
- 2
-
-
- $this
-
-
- panel2
-
-
- 547, 196
-
-
- 2
-
-
- 6
-
-
- 235, 22
-
-
- 4
-
-
- 3
-
-
- True
-
-
- 5
-
-
- groupBox1
-
-
- txtPort
-
-
- 127, 56
+
+ 12, 158
95, 12
-
- System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 10
-
+
+ Alias (remarks)
+
+
+ label6
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 6
+
+
+ 127, 56
+
+
+ 194, 21
+
+
+ 3
+
+
+ txtPort
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 7
+
+
True
-
- Import URL from clipboard
+
+ 12, 60
-
- System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 71, 12
-
- &Cancel
-
-
- 12, 31
-
-
- &OK
-
-
- 11
-
-
- 0
+
+ 2
Server port
-
- 337, 158
+
+ label2
-
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
groupBox1
+
+ 8
+
+
+ 127, 27
+
+
+ 359, 21
+
+
+ 1
+
+
+ txtAddress
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 9
+
+
+ True
+
+
+ 12, 31
+
+
+ 89, 12
+
+
+ 0
+
+
+ Server address
+
+
+ label1
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ groupBox1
+
+
+ 10
+
+
+ Fill
+
+
+ 0, 35
+
+
+ 547, 196
+
+
+ 3
+
+
+ Server
+
+
+ groupBox1
+
+
+ System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 0
+
+
+ 303, 17
+
+
+ 75, 23
+
+
+ 5
+
+
+ &OK
+
+
+ btnOK
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ panel2
+
+
+ 1
+
+
+ Bottom
+
+
+ 0, 231
+
+
+ 547, 60
+
+
+ 7
+
+
+ panel2
+
+
+ System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 1
+
+
+ Top
+
+
+ 0, 25
+
+
+ 547, 10
+
+
+ 6
+
+
+ panel1
+
+
+ System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 2
+
+
+ 17, 17
+
+
+ 235, 22
+
+
+ Import URL from clipboard
+
+
+ 162, 21
+
Import configuration file
0, 0
-
- System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 547, 25
-
- 5
+
+ 8
+
+
+ menuServer
System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 3
-
-
- 1
-
-
- 0, 25
-
-
- 1
-
-
- label13
-
-
- 3
-
-
- label2
-
-
- groupBox1
-
-
- panel2
-
-
- 0, 231
-
-
- 22
-
-
- 547, 291
-
-
- 0
-
-
- v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
- menuItemImportClipboard
-
-
+
$this
-
- 396, 17
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 1
-
-
- System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 3
True
-
- 17, 17
-
+
+ 6, 12
+
+
+ 547, 291
+
+
+ Edit or add a [Socks] server
+
+
+ MenuItem1
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ menuItemImportClipboard
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ AddServer4Form
+
+
+ v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+
\ No newline at end of file
diff --git a/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx b/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx
index 40b56c76..6a3cc081 100644
--- a/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx
+++ b/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx
@@ -123,10 +123,34 @@
服务器
+
+
+ 127, 85
+
+
+ 12, 89
+
+
+ 77, 12
+
+
+ 用户名(可选)
+
+
+ 127, 115
+
+
+ 12, 119
+
+
+ 65, 12
+
+
+ 密码(可选)
+
*手填,方便识别管理
-
83, 12
diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs
index eccef7b5..c9d18b62 100644
--- a/v2rayN/v2rayN/Handler/ConfigHandler.cs
+++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs
@@ -366,7 +366,9 @@ namespace v2rayN.Handler
{
remark = "#" + WebUtility.UrlEncode(vmessItem.remarks);
}
- url = string.Format("{0}:{1}",
+ url = string.Format("{0}:{1}@{2}:{3}",
+ vmessItem.security,
+ vmessItem.id,
vmessItem.address,
vmessItem.port);
url = Utils.Base64Encode(url);
diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs
index 531c501b..fbd585bf 100644
--- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs
+++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs
@@ -400,6 +400,17 @@ namespace v2rayN.Handler
serversItem.address = config.address();
serversItem.port = config.port();
+ if (!string.IsNullOrEmpty(config.security())
+ && !string.IsNullOrEmpty(config.id()))
+ {
+ var socksUsersItem = new SocksUsersItem();
+ socksUsersItem.user = config.security();
+ socksUsersItem.pass = config.id();
+ socksUsersItem.level = 1;
+
+ serversItem.users = new List() { socksUsersItem };
+ }
+
outbound.mux.enabled = false;
outbound.protocol = "socks";
@@ -425,7 +436,21 @@ namespace v2rayN.Handler
{
//远程服务器底层传输配置
streamSettings.network = config.network();
- streamSettings.security = config.streamSecurity();
+ var host = config.requestHost();
+
+ //if tls
+ if (config.streamSecurity() == "tls")
+ {
+ streamSettings.security = config.streamSecurity();
+
+ TlsSettings tlsSettings = new TlsSettings();
+ tlsSettings.allowInsecure = config.allowInsecure();
+ if (!string.IsNullOrWhiteSpace(host))
+ {
+ tlsSettings.serverName = host;
+ }
+ streamSettings.tlsSettings = tlsSettings;
+ }
//streamSettings
switch (config.network())
@@ -463,12 +488,11 @@ namespace v2rayN.Handler
WsSettings wsSettings = new WsSettings();
wsSettings.connectionReuse = true;
- string host2 = config.requestHost();
string path = config.path();
- if (!string.IsNullOrWhiteSpace(host2))
+ if (!string.IsNullOrWhiteSpace(host))
{
wsSettings.headers = new Headers();
- wsSettings.headers.Host = host2;
+ wsSettings.headers.Host = host;
}
if (!string.IsNullOrWhiteSpace(path))
{
@@ -476,35 +500,34 @@ namespace v2rayN.Handler
}
streamSettings.wsSettings = wsSettings;
- TlsSettings tlsSettings = new TlsSettings();
- tlsSettings.allowInsecure = config.allowInsecure();
- if (!string.IsNullOrWhiteSpace(host2))
- {
- tlsSettings.serverName = host2;
- }
- streamSettings.tlsSettings = tlsSettings;
+ //TlsSettings tlsSettings = new TlsSettings();
+ //tlsSettings.allowInsecure = config.allowInsecure();
+ //if (!string.IsNullOrWhiteSpace(host))
+ //{
+ // tlsSettings.serverName = host;
+ //}
+ //streamSettings.tlsSettings = tlsSettings;
break;
//h2
case "h2":
HttpSettings httpSettings = new HttpSettings();
- string host3 = config.requestHost();
- if (!string.IsNullOrWhiteSpace(host3))
+ if (!string.IsNullOrWhiteSpace(host))
{
- httpSettings.host = Utils.String2List(host3);
+ httpSettings.host = Utils.String2List(host);
}
httpSettings.path = config.path();
streamSettings.httpSettings = httpSettings;
- TlsSettings tlsSettings2 = new TlsSettings();
- tlsSettings2.allowInsecure = config.allowInsecure();
- streamSettings.tlsSettings = tlsSettings2;
+ //TlsSettings tlsSettings2 = new TlsSettings();
+ //tlsSettings2.allowInsecure = config.allowInsecure();
+ //streamSettings.tlsSettings = tlsSettings2;
break;
//quic
case "quic":
QuicSettings quicsettings = new QuicSettings();
- quicsettings.security = config.requestHost();
+ quicsettings.security = host;
quicsettings.key = config.path();
quicsettings.header = new Header();
quicsettings.header.type = config.headerType();
@@ -524,9 +547,9 @@ namespace v2rayN.Handler
{
//request填入自定义Host
string request = Utils.GetEmbedText(Global.v2raySampleHttprequestFileName);
- string[] arrHost = config.requestHost().Split(',');
- string host = string.Join("\",\"", arrHost);
- request = request.Replace("$requestHost$", string.Format("\"{0}\"", host));
+ string[] arrHost = host.Split(',');
+ string host2 = string.Join("\",\"", arrHost);
+ request = request.Replace("$requestHost$", string.Format("\"{0}\"", host2));
//request = request.Replace("$requestHost$", string.Format("\"{0}\"", config.requestHost()));
//填入自定义Path
@@ -1159,7 +1182,7 @@ namespace v2rayN.Handler
result = result.Substring(0, indexRemark);
}
//part decode
- int indexS = result.IndexOf(":");
+ int indexS = result.IndexOf("@");
if (indexS > 0)
{
}
@@ -1168,15 +1191,22 @@ namespace v2rayN.Handler
result = Utils.Base64Decode(result);
}
-
- string[] arr21 = result.Split(':');
- int indexPort = result.LastIndexOf(":");
+ string[] arr1 = result.Split('@');
+ if (arr1.Length != 2)
+ {
+ return null;
+ }
+ string[] arr21 = arr1[0].Split(':');
+ //string[] arr22 = arr1[1].Split(':');
+ int indexPort = arr1[1].LastIndexOf(":");
if (arr21.Length != 2 || indexPort < 0)
{
return null;
}
- vmessItem.address = result.Substring(0, indexPort);
- vmessItem.port = Utils.ToInt(result.Substring(indexPort + 1, result.Length - (indexPort + 1)));
+ vmessItem.address = arr1[1].Substring(0, indexPort);
+ vmessItem.port = Utils.ToInt(arr1[1].Substring(indexPort + 1, arr1[1].Length - (indexPort + 1)));
+ vmessItem.security = arr21[0];
+ vmessItem.id = arr21[1];
}
else
{
diff --git a/v2rayN/v2rayN/Mode/V2rayConfig.cs b/v2rayN/v2rayN/Mode/V2rayConfig.cs
index a57c885a..b6502abb 100644
--- a/v2rayN/v2rayN/Mode/V2rayConfig.cs
+++ b/v2rayN/v2rayN/Mode/V2rayConfig.cs
@@ -215,8 +215,30 @@ namespace v2rayN.Mode
///
///
public int level { get; set; }
+
+ ///
+ ///
+ ///
+ public List users { get; set; }
}
+ public class SocksUsersItem
+ {
+ ///
+ ///
+ ///
+ public string user { get; set; }
+ ///
+ ///
+ ///
+ public string pass { get; set; }
+ ///
+ ///
+ ///
+ public int level { get; set; }
+ }
+
+
public class Mux
{
///