diff --git a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs index 4cf4fe18..ee40a2d0 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs @@ -46,6 +46,8 @@ this.txtIP = new System.Windows.Forms.TextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.txtDomain = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.clbProtocol = new System.Windows.Forms.CheckedListBox(); this.panel3.SuspendLayout(); this.panel4.SuspendLayout(); this.panel2.SuspendLayout(); @@ -60,7 +62,8 @@ // // panel3 // - resources.ApplyResources(this.panel3, "panel3"); + this.panel3.Controls.Add(this.clbProtocol); + this.panel3.Controls.Add(this.label3); this.panel3.Controls.Add(this.txtPort); this.panel3.Controls.Add(this.label1); this.panel3.Controls.Add(this.labRoutingTips); @@ -68,6 +71,7 @@ this.panel3.Controls.Add(this.cmbOutboundTag); this.panel3.Controls.Add(this.txtRemarks); this.panel3.Controls.Add(this.label2); + resources.ApplyResources(this.panel3, "panel3"); this.panel3.Name = "panel3"; // // txtPort @@ -82,8 +86,8 @@ // // labRoutingTips // - resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.ForeColor = System.Drawing.Color.Brown; + resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.Name = "labRoutingTips"; // // label4 @@ -93,13 +97,13 @@ // // cmbOutboundTag // - resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag"); this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbOutboundTag.FormattingEnabled = true; this.cmbOutboundTag.Items.AddRange(new object[] { resources.GetString("cmbOutboundTag.Items"), resources.GetString("cmbOutboundTag.Items1"), resources.GetString("cmbOutboundTag.Items2")}); + resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag"); this.cmbOutboundTag.Name = "cmbOutboundTag"; // // txtRemarks @@ -114,15 +118,15 @@ // // panel4 // - resources.ApplyResources(this.panel4, "panel4"); this.panel4.Controls.Add(this.btnClose); this.panel4.Controls.Add(this.btnOK); + resources.ApplyResources(this.panel4, "panel4"); this.panel4.Name = "panel4"; // // 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); @@ -136,15 +140,15 @@ // // panel2 // - resources.ApplyResources(this.panel2, "panel2"); this.panel2.Controls.Add(this.groupBox2); this.panel2.Controls.Add(this.groupBox1); + resources.ApplyResources(this.panel2, "panel2"); this.panel2.Name = "panel2"; // // groupBox2 // - resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Controls.Add(this.txtIP); + resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Name = "groupBox2"; this.groupBox2.TabStop = false; // @@ -155,8 +159,8 @@ // // groupBox1 // - resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Controls.Add(this.txtDomain); + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // @@ -165,6 +169,23 @@ resources.ApplyResources(this.txtDomain, "txtDomain"); this.txtDomain.Name = "txtDomain"; // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // clbProtocol + // + this.clbProtocol.CheckOnClick = true; + resources.ApplyResources(this.clbProtocol, "clbProtocol"); + this.clbProtocol.FormattingEnabled = true; + this.clbProtocol.Items.AddRange(new object[] { + resources.GetString("clbProtocol.Items"), + resources.GetString("clbProtocol.Items1"), + resources.GetString("clbProtocol.Items2")}); + this.clbProtocol.MultiColumn = true; + this.clbProtocol.Name = "clbProtocol"; + // // RoutingSettingDetailsForm // resources.ApplyResources(this, "$this"); @@ -207,5 +228,7 @@ private System.Windows.Forms.Label labRoutingTips; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox txtPort; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckedListBox clbProtocol; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs index 09b5a39e..a0511439 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs +++ b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Windows.Forms; using v2rayN.Base; using v2rayN.Handler; @@ -42,6 +43,16 @@ namespace v2rayN.Forms routingItem.outboundTag = cmbOutboundTag.Text; routingItem.domain = Utils.String2List(txtDomain.Text); routingItem.ip = Utils.String2List(txtIP.Text); + + var protocol = new List(); + for (int i = 0; i < clbProtocol.Items.Count; i++) + { + if (clbProtocol.GetItemChecked(i)) + { + protocol.Add(clbProtocol.Items[i].ToString()); + } + } + routingItem.protocol = protocol; } } private void BindingData() @@ -53,6 +64,17 @@ namespace v2rayN.Forms cmbOutboundTag.Text = routingItem.outboundTag; txtDomain.Text = Utils.List2String(routingItem.domain, true); txtIP.Text = Utils.List2String(routingItem.ip, true); + + if (routingItem.protocol != null) + { + for (int i = 0; i < clbProtocol.Items.Count; i++) + { + if (routingItem.protocol.Contains(clbProtocol.Items[i].ToString())) + { + clbProtocol.SetItemChecked(i, true); + } + } + } } } private void ClearBind() diff --git a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx index 8153fa31..0481d1dd 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx +++ b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx @@ -117,472 +117,607 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - - 32 - - - 30 - - - 31 - - - proxy - - - Fill - - - panel1 - - - 3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - Left - - - NoControl - - - 0 - - - - 29, 12 - - - panel2 - - - RoutingSettingDetailsForm - - - Fill - - - 1 - - - Fill - - - 411, 15 - - - 119, 20 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bottom - Top - - 0 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 344, 417 - - - $this - - - 504, 15 - - - groupBox1 - - - NoControl - - - 6 - - - label1 - - - 742, 437 - + 0, 0 - - 4 - - - panel3 - - - True - - - panel3 - - - 3 - - - panel4 - - - 5 - - - 19, 43 - - - 25 - - - 3, 17 - - - panel3 - - - 274, 20 - - - labRoutingTips - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 491, 20 - - - groupBox1 - - - 1 - - - RoutingSettingDetailsForm - - - 166, 21 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel3 - - - 544, 16 - - - groupBox2 - - - 3 - - - 1 - - - 386, 417 - - - panel3 - - - 392, 0 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - panel4 - - - NoControl - - - Top - - - 598, 16 - - - $this - - - groupBox2 - - - panel3 - - - System.Windows.Forms.Panel, 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 - - - txtPort - - - panel4 - - - 3, 17 - - - 1 - 742, 10 - - 0, 0 - - - 24 - - - label4 - - - &OK - - - 75, 23 - - - btnClose - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 34 - - - 29 - - - block - - - direct - - - 0 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnOK - - - 2 - - - 110, 21 - - - 4 - + 7 - - 0 + + panel1 - - 11 - - - 0 - - - panel3 - - - 8 - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - 0, 10 - - - Remarks - - - Fill - - - 742, 60 - - - 0, 79 - - - $this - - - 47, 12 - - - &Cancel - - - *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP - - - 742, 69 - - - True - - - 6, 12 - - - Port - - - System.Windows.Forms.TextBox, 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 - - - txtIP - - - 0 - - - label2 - - - cmbOutboundTag - - - True - - - 19, 20 - - - NoControl - - - 742, 576 - - - 10 - - - 392, 437 - - - 75, 23 - - - NoControl - - - True - - - 4 - - - 5 - - - txtDomain - - - 84, 16 - - - IP - - + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - 0, 516 + + 3 - - 33 + + 80 - - 47, 12 + + http - - 350, 437 + + tls - + + bittorrent + + + 347, 43 + + + 245, 20 + + + 39 + + + clbProtocol + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + panel3 - - Domain + + 0 - - txtRemarks + + True - - 347, 16 + + NoControl - - Out Tag + + 274, 47 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 53, 12 + + + 36 + + + protocol + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 1 + + + 84, 43 + + + 166, 21 35 + + txtPort + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 2 + + + True + + + NoControl + + + 19, 47 + + + 29, 12 + + + 34 + + + Port + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 3 + + + NoControl + + + 19, 82 + + + 598, 16 + + + 33 + + + *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP + + + labRoutingTips + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 4 + + + True + + + NoControl + + + 274, 20 + + + 47, 12 + + + 32 + + + Out Tag + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 5 + + + proxy + + + direct + + + block + + + 347, 16 + + + 119, 20 + + + 31 + + + cmbOutboundTag + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 6 + + + 84, 16 + + + 166, 21 + + + 30 + + + txtRemarks + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 7 + + + True + + + NoControl + + + 19, 20 + + + 47, 12 + + + 29 + + + Remarks + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 8 + + + Top + + + 0, 10 + + + 742, 111 + + + 8 + + + panel3 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 0 + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 1 + + + Bottom + + + 0, 516 + + + 742, 60 + + + 10 + + + panel4 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + NoControl + + + 504, 15 + + + 75, 23 + + + 4 + + + &Cancel + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 0 + + + NoControl + + + 411, 15 + + + 75, 23 + + + 5 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 1 + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + Fill + + + 0, 121 + + + 742, 395 + + + 11 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + txtIP + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + Fill + + + 392, 0 + + + 350, 395 + + + 4 + + + IP + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + Fill + + + 3, 17 + + + True + + + 344, 375 + + + 25 + + + txtIP + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + txtDomain + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Left + + + 0, 0 + + + 392, 395 + + + 3 + + + Domain + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + Fill + + + 3, 17 + + + True + + + 386, 375 + + + 24 + + + txtDomain + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + True + + 6, 12 + + + 742, 576 + + + RoutingSettingDetailsForm + + + RoutingSettingDetailsForm + + + 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/RoutingSettingForm.cs b/v2rayN/v2rayN/Forms/RoutingSettingForm.cs index e63d4ed8..b51d56d6 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingForm.cs +++ b/v2rayN/v2rayN/Forms/RoutingSettingForm.cs @@ -42,8 +42,9 @@ namespace v2rayN.Forms lvRoutings.Columns.Add(UIRes.I18N("LvAlias"), 100); lvRoutings.Columns.Add("outboundTag", 80); lvRoutings.Columns.Add("port", 80); - lvRoutings.Columns.Add("domain", 200); - lvRoutings.Columns.Add("ip", 200); + lvRoutings.Columns.Add("protocol", 100); + lvRoutings.Columns.Add("domain", 160); + lvRoutings.Columns.Add("ip", 160); lvRoutings.EndUpdate(); } @@ -61,6 +62,7 @@ namespace v2rayN.Forms Utils.AddSubItem(lvItem, "remarks", item.remarks); Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag); Utils.AddSubItem(lvItem, "port", item.port); + Utils.AddSubItem(lvItem, "protocol", Utils.List2String(item.protocol)); Utils.AddSubItem(lvItem, "domain", Utils.List2String(item.domain)); Utils.AddSubItem(lvItem, "ip", Utils.List2String(item.ip)); diff --git a/v2rayN/v2rayN/Forms/RoutingSettingForm.resx b/v2rayN/v2rayN/Forms/RoutingSettingForm.resx index ae3fa1eb..b773ce33 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingForm.resx +++ b/v2rayN/v2rayN/Forms/RoutingSettingForm.resx @@ -147,21 +147,6 @@ 0 - - NoControl - - - 475, 17 - - - 75, 23 - - - 5 - - - &OK - btnOK @@ -198,6 +183,81 @@ 3 + + NoControl + + + 475, 17 + + + 75, 23 + + + 5 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + linkLabelRoutingDoc + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + cmbdomainStrategy + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + Top + + + 0, 25 + + + 765, 51 + + + 11 + + + panel1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + True @@ -261,33 +321,59 @@ 1 - - Top - - - 0, 25 - - - 765, 51 - - - 11 - - - panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 17, 17 + + 203, 186 + + + cmsLv + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Fill + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 + ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu + PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA + BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 + bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp + bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz + dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA + CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp + bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5 + bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3 + ////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0 + ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw== + + + + 3, 3 + + + 751, 505 + + + 12 + + + lvRoutings + + + v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tabPage2 + + + 0 + 202, 22 @@ -339,77 +425,12 @@ Move to bottom (B) - - 203, 186 - - - cmsLv - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz - dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA - CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp - bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5 - bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3 - ////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0 - ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw== - - - - 3, 3 - - - 751, 505 - - - 12 - - - lvRoutings - - - v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tabPage2 - - - 0 - 120, 21 Edit and Function - - 4, 22 - - - 3, 3, 3, 3 - - - 757, 511 - - - 0 - - - RuleList - tabPage2 @@ -446,6 +467,33 @@ 1 + + 4, 22 + + + 3, 3, 3, 3 + + + 757, 511 + + + 0 + + + RuleList + + + tabPage2 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl2 + + + 0 + 139, 17 diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 596a95b3..473400c3 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -214,16 +214,37 @@ namespace v2rayN.Handler { return 0; } + if (Utils.IsNullOrEmpty(rules.port)) + { + rules.port = null; + } + if (rules.domain != null && rules.domain.Count == 0) + { + rules.domain = null; + } + if (rules.ip != null && rules.ip.Count == 0) + { + rules.ip = null; + } + if (rules.protocol != null && rules.protocol.Count == 0) + { + rules.protocol = null; + } + var hasDomainIp = false; if (rules.domain != null && rules.domain.Count > 0) { var it = Utils.DeepCopy(rules); it.ip = null; it.type = "field"; - if (Utils.IsNullOrEmpty(rules.port)) - { - it.port = null; - } + //if (Utils.IsNullOrEmpty(it.port)) + //{ + // it.port = null; + //} + //if (it.protocol != null && it.protocol.Count == 0) + //{ + // it.protocol = null; + //} v2rayConfig.routing.rules.Add(it); hasDomainIp = true; } @@ -232,20 +253,43 @@ namespace v2rayN.Handler var it = Utils.DeepCopy(rules); it.domain = null; it.type = "field"; - if (Utils.IsNullOrEmpty(rules.port)) - { - it.port = null; - } + //if (Utils.IsNullOrEmpty(it.port)) + //{ + // it.port = null; + //} + //if (it.protocol != null && it.protocol.Count == 0) + //{ + // it.protocol = null; + //} v2rayConfig.routing.rules.Add(it); hasDomainIp = true; } - if (!hasDomainIp && !Utils.IsNullOrEmpty(rules.port)) + if (!hasDomainIp) { - var it = Utils.DeepCopy(rules); - it.domain = null; - it.ip = null; - it.type = "field"; - v2rayConfig.routing.rules.Add(it); + if (!Utils.IsNullOrEmpty(rules.port)) + { + var it = Utils.DeepCopy(rules); + //it.domain = null; + //it.ip = null; + //if (it.protocol != null && it.protocol.Count == 0) + //{ + // it.protocol = null; + //} + it.type = "field"; + v2rayConfig.routing.rules.Add(it); + } + else if (rules.protocol != null && rules.protocol.Count > 0) + { + var it = Utils.DeepCopy(rules); + //it.domain = null; + //it.ip = null; + //if (Utils.IsNullOrEmpty(it.port)) + //{ + // it.port = null; + //} + it.type = "field"; + v2rayConfig.routing.rules.Add(it); + } } } catch diff --git a/v2rayN/v2rayN/Mode/RulesItem.cs b/v2rayN/v2rayN/Mode/RulesItem.cs index a4ae121e..bb3a85e4 100644 --- a/v2rayN/v2rayN/Mode/RulesItem.cs +++ b/v2rayN/v2rayN/Mode/RulesItem.cs @@ -6,31 +6,22 @@ namespace v2rayN.Mode [Serializable] public class RulesItem { - public string remarks { get; set; } - /// - /// - /// + public string remarks { get; set; } + public string type { get; set; } - /// - /// - /// + public string port { get; set; } public List inboundTag { get; set; } - /// - /// - /// + public string outboundTag { get; set; } - - /// - /// - /// + public List ip { get; set; } - - /// - /// - /// + public List domain { get; set; } + + public List protocol { get; set; } + } } diff --git a/v2rayN/v2rayN/Resx/Resx.zip b/v2rayN/v2rayN/Resx/Resx.zip deleted file mode 100644 index 0cb38db9..00000000 Binary files a/v2rayN/v2rayN/Resx/Resx.zip and /dev/null differ diff --git a/v2rayN/v2rayN/Sample/custom_routing_block b/v2rayN/v2rayN/Sample/custom_routing_block deleted file mode 100644 index 0cd55ac3..00000000 --- a/v2rayN/v2rayN/Sample/custom_routing_block +++ /dev/null @@ -1 +0,0 @@ -geosite:category-ads-all, diff --git a/v2rayN/v2rayN/Sample/custom_routing_direct b/v2rayN/v2rayN/Sample/custom_routing_direct deleted file mode 100644 index 5408992c..00000000 --- a/v2rayN/v2rayN/Sample/custom_routing_direct +++ /dev/null @@ -1,132 +0,0 @@ -domain:12306.com, -domain:51ym.me, -domain:52pojie.cn, -domain:8686c.com, -domain:abercrombie.com, -domain:adobesc.com, -domain:air-matters.com, -domain:air-matters.io, -domain:airtable.com, -domain:akadns.net, -domain:apache.org, -domain:api.crisp.chat, -domain:api.termius.com, -domain:appshike.com, -domain:appstore.com, -domain:aweme.snssdk.com, -domain:bababian.com, -domain:battle.net, -domain:beatsbydre.com, -domain:bet365.com, -domain:bilibili.cn, -domain:ccgslb.com, -domain:ccgslb.net, -domain:chunbo.com, -domain:chunboimg.com, -domain:clashroyaleapp.com, -domain:cloudsigma.com, -domain:cloudxns.net, -domain:cmfu.com, -domain:culturedcode.com, -domain:dct-cloud.com, -domain:didialift.com, -domain:douyutv.com, -domain:duokan.com, -domain:dytt8.net, -domain:easou.com, -domain:ecitic.net, -domain:eclipse.org, -domain:eudic.net, -domain:ewqcxz.com, -domain:fir.im, -domain:frdic.com, -domain:fresh-ideas.cc, -domain:godic.net, -domain:goodread.com, -domain:haibian.com, -domain:hdslb.net, -domain:hollisterco.com, -domain:hongxiu.com, -domain:hxcdn.net, -domain:images.unsplash.com, -domain:img4me.com, -domain:ipify.org, -domain:ixdzs.com, -domain:jd.hk, -domain:jianshuapi.com, -domain:jomodns.com, -domain:jsboxbbs.com, -domain:knewone.com, -domain:kuaidi100.com, -domain:lemicp.com, -domain:letvcloud.com, -domain:lizhi.io, -domain:localizecdn.com, -domain:lucifr.com, -domain:luoo.net, -domain:mai.tn, -domain:maven.org, -domain:miwifi.com, -domain:moji.com, -domain:moke.com, -domain:mtalk.google.com, -domain:mxhichina.com, -domain:myqcloud.com, -domain:myunlu.com, -domain:netease.com, -domain:nfoservers.com, -domain:nssurge.com, -domain:nuomi.com, -domain:ourdvs.com, -domain:overcast.fm, -domain:paypal.com, -domain:paypalobjects.com, -domain:pgyer.com, -domain:qdaily.com, -domain:qdmm.com, -domain:qin.io, -domain:qingmang.me, -domain:qingmang.mobi, -domain:qqurl.com, -domain:rarbg.to, -domain:rrmj.tv, -domain:ruguoapp.com, -domain:sm.ms, -domain:snwx.com, -domain:soku.com, -domain:startssl.com, -domain:store.steampowered.com, -domain:symcd.com, -domain:teamviewer.com, -domain:tmzvps.com, -domain:trello.com, -domain:trellocdn.com, -domain:ttmeiju.com, -domain:udache.com, -domain:uxengine.net, -domain:weather.bjango.com, -domain:weather.com, -domain:webqxs.com, -domain:weico.cc, -domain:wenku8.net, -domain:werewolf.53site.com, -domain:windowsupdate.com, -domain:wkcdn.com, -domain:workflowy.com, -domain:xdrig.com, -domain:xiaojukeji.com, -domain:xiaomi.net, -domain:xiaomicp.com, -domain:ximalaya.com, -domain:xitek.com, -domain:xmcdn.com, -domain:xslb.net, -domain:xteko.com, -domain:yach.me, -domain:yixia.com, -domain:yunjiasu-cdn.net, -domain:zealer.com, -domain:zgslb.net, -domain:zimuzu.tv, -domain:zmz002.com, -domain:samsungdm.com, \ No newline at end of file diff --git a/v2rayN/v2rayN/Sample/custom_routing_private b/v2rayN/v2rayN/Sample/custom_routing_private deleted file mode 100644 index 8003b809..00000000 --- a/v2rayN/v2rayN/Sample/custom_routing_private +++ /dev/null @@ -1,3 +0,0 @@ -geoip:private, -geoip:cn, -geosite:cn \ No newline at end of file diff --git a/v2rayN/v2rayN/Sample/custom_routing_proxy b/v2rayN/v2rayN/Sample/custom_routing_proxy deleted file mode 100644 index d67a6237..00000000 --- a/v2rayN/v2rayN/Sample/custom_routing_proxy +++ /dev/null @@ -1,33 +0,0 @@ -geosite:google, -geosite:github, -geosite:netflix, -geosite:steam, -geosite:telegram, -geosite:tumblr, -geosite:speedtest, -geosite:bbc, -domain:gvt1.com, -domain:textnow.com, -domain:twitch.tv, -domain:wikileaks.org, -domain:naver.com, -91.108.4.0/22, -91.108.8.0/22, -91.108.12.0/22, -91.108.20.0/22, -91.108.36.0/23, -91.108.38.0/23, -91.108.56.0/22, -149.154.160.0/20, -149.154.164.0/22, -149.154.172.0/22, -74.125.0.0/16, -173.194.0.0/16, -172.217.0.0/16, -216.58.200.0/24, -216.58.220.0/24, -91.108.56.116, -91.108.56.0/24, -109.239.140.0/24, -149.154.167.0/24, -149.154.175.0/24, \ No newline at end of file diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index 3211d957..f6d76a16 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -367,12 +367,8 @@ Settings.settings True - - - -