DomainMatcher can be set to empty

pull/2530/head
2dust 2022-07-30 20:27:27 +08:00
parent 359c6e0f02
commit ae6b3ef7fb
6 changed files with 444 additions and 715 deletions

View File

@ -45,6 +45,7 @@
this.menuRemove = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuSetDefaultRouting = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuImportAdvancedRules = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItemAdvanced = new System.Windows.Forms.ToolStripMenuItem();
this.menuServer = new System.Windows.Forms.MenuStrip();
@ -71,7 +72,6 @@
this.txtBlockDomain = new System.Windows.Forms.TextBox();
this.tabPageRuleList = new System.Windows.Forms.TabPage();
this.lvRoutings = new v2rayN.Base.ListViewFlickerFree();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.cmsLv.SuspendLayout();
@ -135,9 +135,6 @@
//
this.cmbdomainMatcher.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainMatcher.FormattingEnabled = true;
this.cmbdomainMatcher.Items.AddRange(new object[] {
resources.GetString("cmbdomainMatcher.Items"),
resources.GetString("cmbdomainMatcher.Items1")});
resources.ApplyResources(this.cmbdomainMatcher, "cmbdomainMatcher");
this.cmbdomainMatcher.Name = "cmbdomainMatcher";
//
@ -209,6 +206,11 @@
resources.ApplyResources(this.menuSetDefaultRouting, "menuSetDefaultRouting");
this.menuSetDefaultRouting.Click += new System.EventHandler(this.menuSetDefaultRouting_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// menuImportAdvancedRules
//
this.menuImportAdvancedRules.Name = "menuImportAdvancedRules";
@ -390,11 +392,6 @@
this.lvRoutings.View = System.Windows.Forms.View.Details;
this.lvRoutings.DoubleClick += new System.EventHandler(this.lvRoutings_DoubleClick);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// RoutingSettingForm
//
resources.ApplyResources(this, "$this");

View File

@ -20,6 +20,7 @@ namespace v2rayN.Forms
private void RoutingSettingForm_Load(object sender, EventArgs e)
{
ConfigHandler.InitBuiltinRouting(ref config);
cmbdomainMatcher.Items.AddRange(Global.domainMatchers.ToArray());
cmbdomainStrategy.Text = config.domainStrategy;
chkenableRoutingAdvanced.Checked = config.enableRoutingAdvanced;

File diff suppressed because it is too large Load Diff

View File

@ -214,6 +214,7 @@ namespace v2rayN
public static readonly List<string> networks = new List<string> { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
public static readonly List<string> coreTypes = new List<string> { "v2fly", "SagerNet", "Xray" };
public static readonly List<string> domainMatchers = new List<string> { "linear", "mph", "" };
public const string GrpcgunMode = "gun";
public const string GrpcmultiMode = "multi";

View File

@ -95,10 +95,10 @@ namespace v2rayN.Handler
{
config.domainStrategy = "IPIfNonMatch";
}
if (Utils.IsNullOrEmpty(config.domainMatcher))
{
config.domainMatcher = "linear";
}
//if (Utils.IsNullOrEmpty(config.domainMatcher))
//{
// config.domainMatcher = "linear";
//}
//kcp
if (config.kcpItem == null)

View File

@ -200,7 +200,7 @@ namespace v2rayN.Handler
&& v2rayConfig.routing.rules != null)
{
v2rayConfig.routing.domainStrategy = config.domainStrategy;
v2rayConfig.routing.domainMatcher = config.domainMatcher;
v2rayConfig.routing.domainMatcher = Utils.IsNullOrEmpty(config.domainMatcher) ? null : config.domainMatcher;
if (config.enableRoutingAdvanced)
{