diff --git a/v2rayN/v2rayN/Forms/AddServer5Form.Designer.cs b/v2rayN/v2rayN/Forms/AddServer5Form.Designer.cs new file mode 100644 index 00000000..f290e0d9 --- /dev/null +++ b/v2rayN/v2rayN/Forms/AddServer5Form.Designer.cs @@ -0,0 +1,489 @@ +namespace v2rayN.Forms +{ + partial class AddServer5Form + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddServer5Form)); + this.btnClose = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.btnGUID = new System.Windows.Forms.Button(); + this.label13 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label24 = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.panTlsMore = new System.Windows.Forms.Panel(); + this.label21 = new System.Windows.Forms.Label(); + this.cmbAllowInsecure = new System.Windows.Forms.ComboBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.txtPath = new System.Windows.Forms.TextBox(); + this.cmbNetwork = new System.Windows.Forms.ComboBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.cmbStreamSecurity = new System.Windows.Forms.ComboBox(); + this.label12 = new System.Windows.Forms.Label(); + this.txtRequestHost = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.cmbHeaderType = new System.Windows.Forms.ComboBox(); + this.label8 = new System.Windows.Forms.Label(); + this.cmbSecurity = new System.Windows.Forms.ComboBox(); + this.txtRemarks = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.txtId = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtPort = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txtAddress = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.btnOK = new System.Windows.Forms.Button(); + this.panel1 = new System.Windows.Forms.Panel(); + this.menuServer = new System.Windows.Forms.MenuStrip(); + this.MenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.MenuItemImportClient = new System.Windows.Forms.ToolStripMenuItem(); + this.MenuItemImportServer = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.MenuItemImportClipboard = new System.Windows.Forms.ToolStripMenuItem(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.panTlsMore.SuspendLayout(); + this.panel2.SuspendLayout(); + this.menuServer.SuspendLayout(); + this.SuspendLayout(); + // + // btnClose + // + resources.ApplyResources(this.btnClose, "btnClose"); + this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; + 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.btnGUID); + this.groupBox1.Controls.Add(this.label13); + this.groupBox1.Controls.Add(this.groupBox2); + this.groupBox1.Controls.Add(this.label8); + this.groupBox1.Controls.Add(this.cmbSecurity); + this.groupBox1.Controls.Add(this.txtRemarks); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.txtId); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.txtPort); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.txtAddress); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // btnGUID + // + resources.ApplyResources(this.btnGUID, "btnGUID"); + this.btnGUID.Name = "btnGUID"; + this.btnGUID.UseVisualStyleBackColor = true; + this.btnGUID.Click += new System.EventHandler(this.btnGUID_Click); + // + // label13 + // + resources.ApplyResources(this.label13, "label13"); + this.label13.Name = "label13"; + // + // groupBox2 + // + resources.ApplyResources(this.groupBox2, "groupBox2"); + this.groupBox2.Controls.Add(this.label24); + this.groupBox2.Controls.Add(this.label23); + this.groupBox2.Controls.Add(this.panTlsMore); + this.groupBox2.Controls.Add(this.label9); + this.groupBox2.Controls.Add(this.label20); + this.groupBox2.Controls.Add(this.txtPath); + this.groupBox2.Controls.Add(this.cmbNetwork); + this.groupBox2.Controls.Add(this.label7); + this.groupBox2.Controls.Add(this.label19); + this.groupBox2.Controls.Add(this.label18); + this.groupBox2.Controls.Add(this.label17); + this.groupBox2.Controls.Add(this.label16); + this.groupBox2.Controls.Add(this.label14); + this.groupBox2.Controls.Add(this.label15); + this.groupBox2.Controls.Add(this.cmbStreamSecurity); + this.groupBox2.Controls.Add(this.label12); + this.groupBox2.Controls.Add(this.txtRequestHost); + this.groupBox2.Controls.Add(this.label11); + this.groupBox2.Controls.Add(this.label10); + this.groupBox2.Controls.Add(this.cmbHeaderType); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.TabStop = false; + // + // label24 + // + resources.ApplyResources(this.label24, "label24"); + this.label24.Name = "label24"; + // + // label23 + // + resources.ApplyResources(this.label23, "label23"); + this.label23.Name = "label23"; + // + // panTlsMore + // + resources.ApplyResources(this.panTlsMore, "panTlsMore"); + this.panTlsMore.Controls.Add(this.label21); + this.panTlsMore.Controls.Add(this.cmbAllowInsecure); + this.panTlsMore.Name = "panTlsMore"; + // + // label21 + // + resources.ApplyResources(this.label21, "label21"); + this.label21.Name = "label21"; + // + // cmbAllowInsecure + // + resources.ApplyResources(this.cmbAllowInsecure, "cmbAllowInsecure"); + this.cmbAllowInsecure.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbAllowInsecure.FormattingEnabled = true; + this.cmbAllowInsecure.Items.AddRange(new object[] { + resources.GetString("cmbAllowInsecure.Items"), + resources.GetString("cmbAllowInsecure.Items1"), + resources.GetString("cmbAllowInsecure.Items2")}); + this.cmbAllowInsecure.Name = "cmbAllowInsecure"; + // + // label9 + // + resources.ApplyResources(this.label9, "label9"); + this.label9.Name = "label9"; + // + // label20 + // + resources.ApplyResources(this.label20, "label20"); + this.label20.Name = "label20"; + // + // txtPath + // + resources.ApplyResources(this.txtPath, "txtPath"); + this.txtPath.Name = "txtPath"; + // + // cmbNetwork + // + resources.ApplyResources(this.cmbNetwork, "cmbNetwork"); + this.cmbNetwork.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbNetwork.FormattingEnabled = true; + this.cmbNetwork.Items.AddRange(new object[] { + resources.GetString("cmbNetwork.Items"), + resources.GetString("cmbNetwork.Items1"), + resources.GetString("cmbNetwork.Items2"), + resources.GetString("cmbNetwork.Items3"), + resources.GetString("cmbNetwork.Items4")}); + this.cmbNetwork.Name = "cmbNetwork"; + this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged); + // + // label7 + // + resources.ApplyResources(this.label7, "label7"); + this.label7.Name = "label7"; + // + // label19 + // + resources.ApplyResources(this.label19, "label19"); + this.label19.Name = "label19"; + // + // label18 + // + resources.ApplyResources(this.label18, "label18"); + this.label18.Name = "label18"; + // + // label17 + // + resources.ApplyResources(this.label17, "label17"); + this.label17.Name = "label17"; + // + // label16 + // + resources.ApplyResources(this.label16, "label16"); + this.label16.Name = "label16"; + // + // label14 + // + resources.ApplyResources(this.label14, "label14"); + this.label14.Name = "label14"; + // + // label15 + // + resources.ApplyResources(this.label15, "label15"); + this.label15.Name = "label15"; + // + // cmbStreamSecurity + // + resources.ApplyResources(this.cmbStreamSecurity, "cmbStreamSecurity"); + this.cmbStreamSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbStreamSecurity.FormattingEnabled = true; + this.cmbStreamSecurity.Items.AddRange(new object[] { + resources.GetString("cmbStreamSecurity.Items"), + resources.GetString("cmbStreamSecurity.Items1")}); + this.cmbStreamSecurity.Name = "cmbStreamSecurity"; + this.cmbStreamSecurity.SelectedIndexChanged += new System.EventHandler(this.cmbStreamSecurity_SelectedIndexChanged); + // + // label12 + // + resources.ApplyResources(this.label12, "label12"); + this.label12.Name = "label12"; + // + // txtRequestHost + // + resources.ApplyResources(this.txtRequestHost, "txtRequestHost"); + this.txtRequestHost.Name = "txtRequestHost"; + // + // label11 + // + resources.ApplyResources(this.label11, "label11"); + this.label11.Name = "label11"; + // + // label10 + // + resources.ApplyResources(this.label10, "label10"); + this.label10.Name = "label10"; + // + // cmbHeaderType + // + resources.ApplyResources(this.cmbHeaderType, "cmbHeaderType"); + this.cmbHeaderType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbHeaderType.FormattingEnabled = true; + this.cmbHeaderType.Items.AddRange(new object[] { + resources.GetString("cmbHeaderType.Items"), + resources.GetString("cmbHeaderType.Items1"), + resources.GetString("cmbHeaderType.Items2"), + resources.GetString("cmbHeaderType.Items3"), + resources.GetString("cmbHeaderType.Items4"), + resources.GetString("cmbHeaderType.Items5"), + resources.GetString("cmbHeaderType.Items6")}); + this.cmbHeaderType.Name = "cmbHeaderType"; + // + // label8 + // + resources.ApplyResources(this.label8, "label8"); + this.label8.Name = "label8"; + // + // cmbSecurity + // + resources.ApplyResources(this.cmbSecurity, "cmbSecurity"); + this.cmbSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple; + this.cmbSecurity.FormattingEnabled = true; + this.cmbSecurity.Items.AddRange(new object[] { + resources.GetString("cmbSecurity.Items")}); + this.cmbSecurity.Name = "cmbSecurity"; + // + // txtRemarks + // + resources.ApplyResources(this.txtRemarks, "txtRemarks"); + this.txtRemarks.Name = "txtRemarks"; + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.Name = "label6"; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // + // txtId + // + resources.ApplyResources(this.txtId, "txtId"); + this.txtId.Name = "txtId"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // txtPort + // + resources.ApplyResources(this.txtPort, "txtPort"); + this.txtPort.Name = "txtPort"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // txtAddress + // + resources.ApplyResources(this.txtAddress, "txtAddress"); + this.txtAddress.Name = "txtAddress"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // panel2 + // + resources.ApplyResources(this.panel2, "panel2"); + this.panel2.Controls.Add(this.btnClose); + this.panel2.Controls.Add(this.btnOK); + this.panel2.Name = "panel2"; + // + // btnOK + // + resources.ApplyResources(this.btnOK, "btnOK"); + this.btnOK.Name = "btnOK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // panel1 + // + resources.ApplyResources(this.panel1, "panel1"); + this.panel1.Name = "panel1"; + // + // menuServer + // + resources.ApplyResources(this.menuServer, "menuServer"); + this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MenuItem1}); + this.menuServer.Name = "menuServer"; + // + // MenuItem1 + // + resources.ApplyResources(this.MenuItem1, "MenuItem1"); + this.MenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MenuItemImportClient, + this.MenuItemImportServer, + this.toolStripSeparator1, + this.MenuItemImportClipboard}); + this.MenuItem1.Name = "MenuItem1"; + // + // MenuItemImportClient + // + resources.ApplyResources(this.MenuItemImportClient, "MenuItemImportClient"); + this.MenuItemImportClient.Name = "MenuItemImportClient"; + this.MenuItemImportClient.Click += new System.EventHandler(this.MenuItemImportClient_Click); + // + // MenuItemImportServer + // + resources.ApplyResources(this.MenuItemImportServer, "MenuItemImportServer"); + this.MenuItemImportServer.Name = "MenuItemImportServer"; + this.MenuItemImportServer.Click += new System.EventHandler(this.MenuItemImportServer_Click); + // + // toolStripSeparator1 + // + resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1"); + this.toolStripSeparator1.Name = "toolStripSeparator1"; + // + // MenuItemImportClipboard + // + resources.ApplyResources(this.MenuItemImportClipboard, "MenuItemImportClipboard"); + this.MenuItemImportClipboard.Name = "MenuItemImportClipboard"; + this.MenuItemImportClipboard.Click += new System.EventHandler(this.MenuItemImportClipboard_Click); + // + // AddServer5Form + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnClose; + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.Controls.Add(this.menuServer); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "AddServer5Form"; + this.Load += new System.EventHandler(this.AddServer5Form_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.panTlsMore.ResumeLayout(false); + this.panTlsMore.PerformLayout(); + this.panel2.ResumeLayout(false); + this.menuServer.ResumeLayout(false); + this.menuServer.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.TextBox txtRemarks; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txtId; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtPort; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtAddress; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cmbSecurity; + private System.Windows.Forms.ComboBox cmbNetwork; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.TextBox txtRequestHost; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.ComboBox cmbHeaderType; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.MenuStrip menuServer; + private System.Windows.Forms.ToolStripMenuItem MenuItem1; + private System.Windows.Forms.ToolStripMenuItem MenuItemImportClient; + private System.Windows.Forms.ToolStripMenuItem MenuItemImportServer; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.ComboBox cmbStreamSecurity; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem MenuItemImportClipboard; + private System.Windows.Forms.Button btnGUID; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.TextBox txtPath; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.ComboBox cmbAllowInsecure; + private System.Windows.Forms.Panel panTlsMore; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.Label label23; + } +} \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServer5Form.cs b/v2rayN/v2rayN/Forms/AddServer5Form.cs new file mode 100644 index 00000000..568ebd63 --- /dev/null +++ b/v2rayN/v2rayN/Forms/AddServer5Form.cs @@ -0,0 +1,284 @@ +using System; +using System.Windows.Forms; +using v2rayN.Handler; +using v2rayN.Mode; + +namespace v2rayN.Forms +{ + public partial class AddServer5Form : BaseForm + { + public int EditIndex { get; set; } + VmessItem vmessItem = null; + + public AddServer5Form() + { + InitializeComponent(); + } + + private void AddServer5Form_Load(object sender, EventArgs e) + { + if (EditIndex >= 0) + { + vmessItem = config.vmess[EditIndex]; + BindingServer(); + } + else + { + vmessItem = new VmessItem(); + ClearServer(); + } + } + + /// + /// 绑定数据 + /// + private void BindingServer() + { + txtAddress.Text = vmessItem.address; + txtPort.Text = vmessItem.port.ToString(); + txtId.Text = vmessItem.id; + cmbSecurity.Text = vmessItem.security; + cmbNetwork.Text = vmessItem.network; + txtRemarks.Text = vmessItem.remarks; + + cmbHeaderType.Text = vmessItem.headerType; + txtRequestHost.Text = vmessItem.requestHost; + txtPath.Text = vmessItem.path; + cmbStreamSecurity.Text = vmessItem.streamSecurity; + cmbAllowInsecure.Text = vmessItem.allowInsecure; + } + + + /// + /// 清除设置 + /// + private void ClearServer() + { + txtAddress.Text = ""; + txtPort.Text = ""; + txtId.Text = ""; + cmbSecurity.Text = Global.DefaultSecurity; + cmbNetwork.Text = Global.DefaultNetwork; + txtRemarks.Text = ""; + + cmbHeaderType.Text = Global.None; + txtRequestHost.Text = ""; + cmbStreamSecurity.Text = ""; + cmbAllowInsecure.Text = ""; + txtPath.Text = ""; + } + + + private void cmbNetwork_SelectedIndexChanged(object sender, EventArgs e) + { + SetHeaderType(); + } + + /// + /// 设置伪装选项 + /// + private void SetHeaderType() + { + cmbHeaderType.Items.Clear(); + + string network = cmbNetwork.Text; + if (Utils.IsNullOrEmpty(network)) + { + cmbHeaderType.Items.Add(Global.None); + return; + } + + cmbHeaderType.Items.Add(Global.None); + if (network.Equals(Global.DefaultNetwork)) + { + cmbHeaderType.Items.Add(Global.TcpHeaderHttp); + } + else if (network.Equals("kcp") || network.Equals("quic")) + { + cmbHeaderType.Items.Add("srtp"); + cmbHeaderType.Items.Add("utp"); + cmbHeaderType.Items.Add("wechat-video"); + cmbHeaderType.Items.Add("dtls"); + cmbHeaderType.Items.Add("wireguard"); + } + else + { + } + cmbHeaderType.Text = Global.None; + } + + private void btnOK_Click(object sender, EventArgs e) + { + string address = txtAddress.Text; + string port = txtPort.Text; + string id = txtId.Text; + string security = cmbSecurity.Text; + string network = cmbNetwork.Text; + string remarks = txtRemarks.Text; + + string headerType = cmbHeaderType.Text; + string requestHost = txtRequestHost.Text; + string path = txtPath.Text; + string streamSecurity = cmbStreamSecurity.Text; + string allowInsecure = cmbAllowInsecure.Text; + + if (Utils.IsNullOrEmpty(address)) + { + UI.Show(UIRes.I18N("FillServerAddress")); + return; + } + if (Utils.IsNullOrEmpty(port) || !Utils.IsNumberic(port)) + { + UI.Show(UIRes.I18N("FillCorrectServerPort")); + return; + } + if (Utils.IsNullOrEmpty(id)) + { + UI.Show(UIRes.I18N("FillUUID")); + return; + } + + + vmessItem.address = address; + vmessItem.port = Utils.ToInt(port); + vmessItem.id = id; + vmessItem.security = security; + vmessItem.network = network; + vmessItem.remarks = remarks; + + vmessItem.headerType = headerType; + vmessItem.requestHost = requestHost.Replace(" ", ""); + vmessItem.path = path.Replace(" ", ""); + vmessItem.streamSecurity = streamSecurity; + vmessItem.allowInsecure = allowInsecure; + + if (ConfigHandler.AddServer(ref config, vmessItem, EditIndex) == 0) + { + this.DialogResult = DialogResult.OK; + } + else + { + UI.ShowWarning(UIRes.I18N("OperationFailed")); + } + } + + private void btnGUID_Click(object sender, EventArgs e) + { + txtId.Text = Utils.GetGUID(); + } + + private void btnClose_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + } + + + #region 导入客户端/服务端配置 + + /// + /// 导入客户端 + /// + /// + /// + private void MenuItemImportClient_Click(object sender, EventArgs e) + { + MenuItemImport(1); + } + + /// + /// 导入服务端 + /// + /// + /// + private void MenuItemImportServer_Click(object sender, EventArgs e) + { + MenuItemImport(2); + } + + private void MenuItemImport(int type) + { + ClearServer(); + + OpenFileDialog fileDialog = new OpenFileDialog + { + Multiselect = false, + Filter = "Config|*.json|All|*.*" + }; + if (fileDialog.ShowDialog() != DialogResult.OK) + { + return; + } + string fileName = fileDialog.FileName; + if (Utils.IsNullOrEmpty(fileName)) + { + return; + } + string msg; + VmessItem vmessItem; + if (type.Equals(1)) + { + vmessItem = V2rayConfigHandler.ImportFromClientConfig(fileName, out msg); + } + else + { + vmessItem = V2rayConfigHandler.ImportFromServerConfig(fileName, out msg); + } + if (vmessItem == null) + { + UI.ShowWarning(msg); + return; + } + + txtAddress.Text = vmessItem.address; + txtPort.Text = vmessItem.port.ToString(); + txtId.Text = vmessItem.id; + txtRemarks.Text = vmessItem.remarks; + cmbNetwork.Text = vmessItem.network; + cmbHeaderType.Text = vmessItem.headerType; + txtRequestHost.Text = vmessItem.requestHost; + txtPath.Text = vmessItem.path; + cmbStreamSecurity.Text = vmessItem.streamSecurity; + } + + /// + /// 从剪贴板导入URL + /// + /// + /// + private void MenuItemImportClipboard_Click(object sender, EventArgs e) + { + ClearServer(); + + VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg); + if (vmessItem == null) + { + UI.ShowWarning(msg); + return; + } + + txtAddress.Text = vmessItem.address; + txtPort.Text = vmessItem.port.ToString(); + txtId.Text = vmessItem.id; + txtRemarks.Text = vmessItem.remarks; + cmbNetwork.Text = vmessItem.network; + cmbHeaderType.Text = vmessItem.headerType; + txtRequestHost.Text = vmessItem.requestHost; + txtPath.Text = vmessItem.path; + cmbStreamSecurity.Text = vmessItem.streamSecurity; + } + #endregion + + private void cmbStreamSecurity_SelectedIndexChanged(object sender, EventArgs e) + { + string security = cmbStreamSecurity.Text; + if (Utils.IsNullOrEmpty(security)) + { + panTlsMore.Hide(); + } + else + { + panTlsMore.Show(); + } + } + } +} diff --git a/v2rayN/v2rayN/Forms/AddServer5Form.resx b/v2rayN/v2rayN/Forms/AddServer5Form.resx new file mode 100644 index 00000000..57db8697 --- /dev/null +++ b/v2rayN/v2rayN/Forms/AddServer5Form.resx @@ -0,0 +1,1311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + + 113, 12 + + + 285, 179 + + + 124, 62 + + + 6 + + + Path + + + 83, 12 + + + Transport protocol(network) + + + 7 + + + groupBox1 + + + 1 + + + label15 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + cmbStreamSecurity + + + 3)h2 host Separated by commas (,) + + + none + + + + Top + + + + 3 + + + 17 + + + false + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 19 + + + True + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6 + + + 21 + + + 411, 83 + + + Address + + + groupBox1 + + + 75, 23 + + + 59, 12 + + + 1)ws path + + + 19 + + + True + + + 26 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + txtId + + + True + + + 729, 499 + + + + + + 12, 89 + + + groupBox2 + + + tls + + + True + + + 299, 12 + + + cmbAllowInsecure + + + 127, 85 + + + 16 + + + 12, 179 + + + &Cancel + + + label10 + + + 723, 281 + + + 5 + + + label21 + + + 359, 21 + + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Edit or add a [VLESS] server + + + 143, 12 + + + groupBox2 + + + 17 + + + toolStripSeparator1 + + + NoControl + + + 21 + + + label11 + + + 5 + + + 158, 90 + + + 2 + + + 29, 12 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 237, 22 + + + 12 + + + 3)QUIC key + + + 127, 56 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + txtPort + + + 2 + + + groupBox2 + + + Bottom + + + True + + + 127, 175 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 29, 12 + + + True + + + ws + + + 11 + + + 9, 66 + + + 13 + + + Import server configuration + + + 6, 12 + + + 1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 15 + + + label17 + + + panel1 + + + groupBox2 + + + 5 + + + 215, 12 + + + 0, 0 + + + 396, 17 + + + 338, 35 + + + 12, 60 + + + MenuItemImportClient + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + &Generate + + + Encryption method (encryption) + + + txtRemarks + + + v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + groupBox2 + + + true + + + panTlsMore + + + True + + + cmbNetwork + + + 284, 234 + + + 95, 12 + + + 350, 32 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + True + + + 24 + + + 127, 27 + + + label12 + + + 729, 594 + + + True + + + 282, 66 + + + 12 + + + *tcp or kcp or QUIC camouflage type, default none + + + 25 + + + label23 + + + groupBox1 + + + 143, 20 + + + $this + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 33 + + + 6 + + + 0 + + + 2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label8 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label13 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 35 + + + 13 + + + 9 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 11 + + + True + + + 469, 85 + + + label9 + + + label20 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label18 + + + MenuItem1 + + + label1 + + + 13 + + + 34 + + + 22 + + + 143, 20 + + + groupBox2 + + + groupBox2 + + + btnClose + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label19 + + + 143, 21 + + + 95, 12 + + + groupBox1 + + + 0, 35 + + + panTlsMore + + + 729, 60 + + + allowInsecure + + + True + + + True + + + 469, 115 + + + quic + + + groupBox2 + + + h2 + + + kcp + + + 7 + + + 143, 21 + + + 526, 162 + + + 18 + + + 12, 147 + + + 18 + + + groupBox1 + + + label2 + + + groupBox2 + + + 234, 6 + + + groupBox2 + + + 119, 12 + + + 278, 21 + + + True + + + True + + + Bottom + + + 91, 20 + + + 53, 12 + + + 27 + + + groupBox2 + + + groupBox2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Port + + + groupBox2 + + + Fill + + + 10 + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 75, 23 + + + 4 + + + True + + + 11 + + + groupBox1 + + + 8 + + + *Recommended (none) + + + 4 + + + groupBox1 + + + panel2 + + + 143, 20 + + + 23 + + + 1 + + + 6 + + + 10 + + + groupBox2 + + + 14 + + + True + + + 3, 215 + + + Import configuration file + + + wechat-video + + + 9, 32 + + + btnOK + + + 729, 10 + + + 107, 7 + + + 470, 131 + + + True + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 22 + + + 300, 53 + + + 12, 31 + + + 14 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dtls + + + 47, 12 + + + MenuItemImportServer + + + groupBox2 + + + panel2 + + + 0, 534 + + + groupBox1 + + + AddServer5Form + + + wireguard + + + groupBox1 + + + Server + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 303, 17 + + + 2)ws host + + + txtAddress + + + True + + + 2)h2 path + + + True + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 167, 12 + + + 8 + + + Transport + + + groupBox2 + + + * Fill in manually + + + 9, 157 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 396, 54 + + + True + + + 12, 11 + + + 89, 12 + + + 29 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1 + + + True + + + txtPath + + + 162, 21 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + txtRequestHost + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Alias (remarks) + + + 124, 157 + + + label7 + + + 4 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + &OK + + + 7 + + + 3 + + + http + + + 526, 179 + + + 9 + + + groupBox2 + + + menuServer + + + 20 + + + TLS + + + 1 + + + 3 + + + UUID(id) + + + $this + + + MenuItemImportClipboard + + + $this + + + 3 + + + groupBox1 + + + 237, 22 + + + 143, 20 + + + panTlsMore + + + 8 + + + Camouflage domain(host) + + + 0 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 113, 12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 192, 28 + + + 203, 12 + + + utp + + + 30 + + + 12 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 23 + + + 8 + + + 2 + + + 9, 94 + + + label3 + + + srtp + + + 5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Import URL from clipboard + + + 469, 100 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 185, 12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + True + + + *Default value tcp + + + 31 + + + 124, 242 + + + 9, 246 + + + 353, 147 + + + none + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + label5 + + + 3 + + + label16 + + + groupBox1 + + + 237, 22 + + + 16 + + + 1 + + + 28 + + + + + + groupBox2 + + + Import client configuration + + + 15 + + + 4)QUIC securty + + + 0, 25 + + + cmbSecurity + + + tcp + + + groupBox2 + + + btnGUID + + + 75, 23 + + + 23, 12 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + Camouflage type + + + 0 + + + groupBox2 + + + NoControl + + + 1)http host Separated by commas (,) + + + label24 + + + 59, 12 + + + panel2 + + + 65, 12 + + + 195, 143 + + + $this + + + True + + + label6 + + + 59, 12 + + + 10 + + + 729, 25 + + + cmbHeaderType + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 526, 197 + + + label14 + + + True + + + zh-Hans + + + 17, 17 + + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServer5Form.zh-Hans.resx b/v2rayN/v2rayN/Forms/AddServer5Form.zh-Hans.resx new file mode 100644 index 00000000..5df0dd10 --- /dev/null +++ b/v2rayN/v2rayN/Forms/AddServer5Form.zh-Hans.resx @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 取消(&C) + + + 服务器 + + + 生成(&G) + + + *手填,方便识别管理 + + + 底层传输方式(transport) + + + + 95, 12 + + + 3)QUIC 加密密钥 + + + 95, 12 + + + 4)QUIC 加密方式 + + + 167, 12 + + + 跳过证书验证(allowInsecure) + + + 223, 7 + + + 143, 12 + + + *默认tcp,选错会无法连接 + + + 149, 12 + + + 3)h2 host中间逗号(,)隔开 + + + 127, 32 + + + 211, 20 + + + 107, 12 + + + 传输协议(network) + + + 65, 12 + + + 路径(path) + + + 161, 12 + + + 1)http host中间逗号(,)隔开 + + + 77, 12 + + + 底层传输安全 + + + 197, 12 + + + *tcp或kcp或QUIC伪装类型,默认none + + + 124, 94 + + + 334, 51 + + + 89, 12 + + + 伪装类型(type) + + + 89, 12 + + + 伪装域名(host) + + + 71, 12 + + + *非空(none) + + + 127, 143 + + + 211, 20 + + + 83, 12 + + + 别名(remarks) + + + 113, 12 + + + 加密方式(security) + + + 65, 12 + + + 用户ID(id) + + + 65, 12 + + + 端口(port) + + + 83, 12 + + + 地址(address) + + + 确定(&O) + + + 171, 22 + + + 导入客户端配置 + + + 171, 22 + + + 导入服务端配置 + + + 168, 6 + + + 171, 22 + + + 从剪贴板导入URL + + + + False + + + 92, 21 + + + 导入配置文件 + + + 编辑或添加[VLESS]服务器 + + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/MainForm.Designer.cs b/v2rayN/v2rayN/Forms/MainForm.Designer.cs index 7ec70cfe..917e788e 100644 --- a/v2rayN/v2rayN/Forms/MainForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/MainForm.Designer.cs @@ -124,6 +124,7 @@ this.tsbPromotion = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.tsbClose = new System.Windows.Forms.ToolStripButton(); + this.menuAddVlessServer = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); @@ -176,6 +177,7 @@ this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20); this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuAddVmessServer, + this.menuAddVlessServer, this.menuAddShadowsocksServer, this.menuAddSocksServer, this.menuAddCustomServer, @@ -204,7 +206,6 @@ this.menuExport2ShareUrl, this.menuExport2SubContent}); this.cmsLv.Name = "cmsLv"; - this.cmsLv.OwnerItem = this.tsbServer; resources.ApplyResources(this.cmsLv, "cmsLv"); // // menuAddVmessServer @@ -373,7 +374,6 @@ // // tsbServer // - this.tsbServer.DropDown = this.cmsLv; this.tsbServer.Image = global::v2rayN.Properties.Resources.server; resources.ApplyResources(this.tsbServer, "tsbServer"); this.tsbServer.Name = "tsbServer"; @@ -806,6 +806,12 @@ this.tsbClose.Name = "tsbClose"; this.tsbClose.Click += new System.EventHandler(this.tsbClose_Click); // + // menuAddVlessServer + // + this.menuAddVlessServer.Name = "menuAddVlessServer"; + resources.ApplyResources(this.menuAddVlessServer, "menuAddVlessServer"); + this.menuAddVlessServer.Click += new System.EventHandler(this.menuAddVlessServer_Click); + // // MainForm // resources.ApplyResources(this, "$this"); @@ -936,6 +942,7 @@ private System.Windows.Forms.ToolStripMenuItem tsbTestMe; private System.Windows.Forms.ToolStripButton tsbReload; private System.Windows.Forms.ToolStripButton tsbQRCodeSwitch; + private System.Windows.Forms.ToolStripMenuItem menuAddVlessServer; } } diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index 3ca10813..be5fe009 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -404,7 +404,7 @@ namespace v2rayN.Forms { return; } - + } #endregion @@ -513,6 +513,19 @@ namespace v2rayN.Forms LoadV2ray(); } } + else if (config.vmess[index].configType == (int)EConfigType.Vless) + { + AddServer5Form fm = new AddServer5Form + { + EditIndex = index + }; + if (fm.ShowDialog() == DialogResult.OK) + { + //刷新 + RefreshServers(); + LoadV2ray(); + } + } else { AddServer2Form fm2 = new AddServer2Form @@ -600,6 +613,20 @@ namespace v2rayN.Forms } } + private void menuAddVlessServer_Click(object sender, EventArgs e) + { + var fm = new AddServer5Form + { + EditIndex = -1 + }; + if (fm.ShowDialog() == DialogResult.OK) + { + //刷新 + RefreshServers(); + LoadV2ray(); + } + } + private void menuRemoveServer_Click(object sender, EventArgs e) { @@ -1604,5 +1631,6 @@ namespace v2rayN.Forms #endregion + } } diff --git a/v2rayN/v2rayN/Forms/MainForm.resx b/v2rayN/v2rayN/Forms/MainForm.resx index 82105967..cca0d7a7 100644 --- a/v2rayN/v2rayN/Forms/MainForm.resx +++ b/v2rayN/v2rayN/Forms/MainForm.resx @@ -134,6 +134,12 @@ Add [VMess] server + + 355, 22 + + + Add [VLESS] server + 355, 22 @@ -284,20 +290,8 @@ Export subscription (base64) share to clipboard - - Magenta - - - 64, 53 - - - Servers - - - ImageAboveText - - 356, 556 + 356, 600 cmsLv @@ -419,6 +413,18 @@ 0 + + Magenta + + + 64, 53 + + + Servers + + + ImageAboveText + 17, 17 @@ -753,13 +759,13 @@ 6, 56 - 125, 22 + 180, 22 Settings - 125, 22 + 180, 22 Updates @@ -1490,6 +1496,12 @@ System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + menuAddVlessServer + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + MainForm diff --git a/v2rayN/v2rayN/Mode/EConfigType.cs b/v2rayN/v2rayN/Mode/EConfigType.cs index 733c8556..2d7ab219 100644 --- a/v2rayN/v2rayN/Mode/EConfigType.cs +++ b/v2rayN/v2rayN/Mode/EConfigType.cs @@ -6,6 +6,7 @@ namespace v2rayN.Mode Vmess = 1, Custom = 2, Shadowsocks = 3, - Socks = 4 + Socks = 4, + Vless = 5 } } diff --git a/v2rayN/v2rayN/Mode/V2rayConfig.cs b/v2rayN/v2rayN/Mode/V2rayConfig.cs index 5d4ab5df..be1ad4a0 100644 --- a/v2rayN/v2rayN/Mode/V2rayConfig.cs +++ b/v2rayN/v2rayN/Mode/V2rayConfig.cs @@ -132,6 +132,13 @@ namespace v2rayN.Mode /// /// public List clients { get; set; } + + + /// + /// VLESS + /// + public string decryption { get; set; } + } public class UsersItem @@ -152,6 +159,11 @@ namespace v2rayN.Mode /// /// public string security { get; set; } + + /// + /// VLESS + /// + public string encryption { get; set; } } public class Sniffing { diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index 308d38cd..8a004c44 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -107,6 +107,12 @@ Component + + Form + + + AddServer5Form.cs + Form @@ -231,6 +237,14 @@ AddServer3Form.cs Designer + + AddServer5Form.cs + Designer + + + AddServer5Form.cs + Designer + AddServerForm.cs Designer