pull/1232/head
2dust 2020-12-31 20:15:01 +08:00
parent 656451f604
commit d8ee3c3bba
13 changed files with 845 additions and 753 deletions

View File

@ -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;
}
}

View File

@ -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<string>();
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()

File diff suppressed because it is too large Load Diff

View File

@ -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));

View File

@ -147,21 +147,6 @@
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>475, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
@ -198,6 +183,81 @@
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>475, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;linkLabelRoutingDoc.Name" xml:space="preserve">
<value>linkLabelRoutingDoc</value>
</data>
<data name="&gt;&gt;linkLabelRoutingDoc.Type" xml:space="preserve">
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;linkLabelRoutingDoc.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;linkLabelRoutingDoc.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Name" xml:space="preserve">
<value>cmbdomainStrategy</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>765, 51</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="linkLabelRoutingDoc.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -261,33 +321,59 @@
<data name="&gt;&gt;cmbdomainStrategy.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>765, 51</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 186</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
</data>
<data name="&gt;&gt;cmsLv.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="lvRoutings.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="lvRoutings.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>751, 505</value>
</data>
<data name="lvRoutings.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;lvRoutings.Name" xml:space="preserve">
<value>lvRoutings</value>
</data>
<data name="&gt;&gt;lvRoutings.Type" xml:space="preserve">
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvRoutings.Parent" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;lvRoutings.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
@ -339,77 +425,12 @@
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>Move to bottom (B)</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 186</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
</data>
<data name="&gt;&gt;cmsLv.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="lvRoutings.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="lvRoutings.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>751, 505</value>
</data>
<data name="lvRoutings.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;lvRoutings.Name" xml:space="preserve">
<value>lvRoutings</value>
</data>
<data name="&gt;&gt;lvRoutings.Type" xml:space="preserve">
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvRoutings.Parent" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;lvRoutings.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Edit and Function</value>
</data>
<data name="tabPage2.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="tabPage2.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>757, 511</value>
</data>
<data name="tabPage2.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>RuleList</value>
</data>
<data name="&gt;&gt;tabPage2.Name" xml:space="preserve">
<value>tabPage2</value>
</data>
@ -446,6 +467,33 @@
<data name="&gt;&gt;tabControl2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="tabPage2.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="tabPage2.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>757, 511</value>
</data>
<data name="tabPage2.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>RuleList</value>
</data>
<data name="&gt;&gt;tabPage2.Name" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;tabPage2.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tabPage2.Parent" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="&gt;&gt;tabPage2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>139, 17</value>
</metadata>

View File

@ -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

View File

@ -6,31 +6,22 @@ namespace v2rayN.Mode
[Serializable]
public class RulesItem
{
public string remarks { get; set; }
/// <summary>
///
/// </summary>
public string remarks { get; set; }
public string type { get; set; }
/// <summary>
///
/// </summary>
public string port { get; set; }
public List<string> inboundTag { get; set; }
/// <summary>
///
/// </summary>
public string outboundTag { get; set; }
/// <summary>
///
/// </summary>
public List<string> ip { get; set; }
/// <summary>
///
/// </summary>
public List<string> domain { get; set; }
public List<string> protocol { get; set; }
}
}

Binary file not shown.

View File

@ -1 +0,0 @@
geosite:category-ads-all,

View File

@ -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,

View File

@ -1,3 +0,0 @@
geoip:private,
geoip:cn,
geosite:cn

View File

@ -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,

View File

@ -367,12 +367,8 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Sample\custom_routing_block" />
<EmbeddedResource Include="Sample\custom_routing_direct" />
<EmbeddedResource Include="Sample\custom_routing_proxy" />
<None Include="Resources\sysproxy.exe.gz" />
<None Include="Resources\sysproxy64.exe.gz" />
<EmbeddedResource Include="Sample\custom_routing_private" />
<EmbeddedResource Include="Sample\custom_routing_rules" />
<Protobuf Include="Protos\Statistics.proto" />
</ItemGroup>