diff --git a/Netch/Controllers/NFController.cs b/Netch/Controllers/NFController.cs index b76917d1..da628f9e 100644 --- a/Netch/Controllers/NFController.cs +++ b/Netch/Controllers/NFController.cs @@ -34,9 +34,9 @@ namespace Netch.Controllers Dial(NameList.TYPE_UDPLISN, p.ToString()); // Server - Dial(NameList.TYPE_FILTERUDP, (Global.Settings.Redirector.ProxyProtocol != PortType.TCP).ToString().ToLower()); - Dial(NameList.TYPE_FILTERTCP, (Global.Settings.Redirector.ProxyProtocol != PortType.UDP).ToString().ToLower()); - dial_Server(Global.Settings.Redirector.ProxyProtocol); + Dial(NameList.TYPE_FILTERUDP, (Global.Settings.Redirector.FilterProtocol != PortType.TCP).ToString().ToLower()); + Dial(NameList.TYPE_FILTERTCP, (Global.Settings.Redirector.FilterProtocol != PortType.UDP).ToString().ToLower()); + dial_Server(Global.Settings.Redirector.FilterProtocol); // Mode Rule dial_Name(mode); diff --git a/Netch/Forms/SettingForm.Designer.cs b/Netch/Forms/SettingForm.Designer.cs index bbadffe7..5a68ad21 100644 --- a/Netch/Forms/SettingForm.Designer.cs +++ b/Netch/Forms/SettingForm.Designer.cs @@ -54,13 +54,13 @@ namespace Netch.Forms this.LanguageLabel = new System.Windows.Forms.Label(); this.LanguageComboBox = new System.Windows.Forms.ComboBox(); this.NFTabPage = new System.Windows.Forms.TabPage(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.ProcessProxyProtocolLabel = new System.Windows.Forms.Label(); - this.ProcessProxyProtocolComboBox = new System.Windows.Forms.ComboBox(); + this.ProcessFilterProtocolLabel = new System.Windows.Forms.Label(); + this.ProcessFilterProtocolComboBox = new System.Windows.Forms.ComboBox(); this.DNSHijackCheckBox = new System.Windows.Forms.CheckBox(); this.DNSHijackHostTextBox = new System.Windows.Forms.TextBox(); - this.ICMPHijackCheckBox = new System.Windows.Forms.CheckBox(); - this.ICMPHijackHostTextBox = new System.Windows.Forms.TextBox(); + this.FilterICMPCheckBox = new System.Windows.Forms.CheckBox(); + this.ICMPDelayLabel = new System.Windows.Forms.Label(); + this.ICMPDelayTextBox = new System.Windows.Forms.TextBox(); this.RedirectorSSCheckBox = new System.Windows.Forms.CheckBox(); this.ChildProcessHandleCheckBox = new System.Windows.Forms.CheckBox(); this.WinTUNTabPage = new System.Windows.Forms.TabPage(); @@ -104,19 +104,18 @@ namespace Netch.Forms this.CheckBetaUpdateCheckBox = new System.Windows.Forms.CheckBox(); this.UpdateServersWhenOpenedCheckBox = new System.Windows.Forms.CheckBox(); this.AioDNSTabPage = new System.Windows.Forms.TabPage(); - this.AioDNSListenPortLabel = new System.Windows.Forms.Label(); - this.AioDNSListenPortTextBox = new System.Windows.Forms.TextBox(); this.ChinaDNSLabel = new System.Windows.Forms.Label(); this.ChinaDNSTextBox = new System.Windows.Forms.TextBox(); this.OtherDNSLabel = new System.Windows.Forms.Label(); this.OtherDNSTextBox = new System.Windows.Forms.TextBox(); + this.AioDNSListenPortLabel = new System.Windows.Forms.Label(); + this.AioDNSListenPortTextBox = new System.Windows.Forms.TextBox(); this.ControlButton = new System.Windows.Forms.Button(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.TabControl.SuspendLayout(); this.GeneralTabPage.SuspendLayout(); this.PortGroupBox.SuspendLayout(); this.NFTabPage.SuspendLayout(); - this.groupBox1.SuspendLayout(); this.WinTUNTabPage.SuspendLayout(); this.WinTUNGroupBox.SuspendLayout(); this.v2rayTabPage.SuspendLayout(); @@ -220,7 +219,7 @@ namespace Netch.Forms this.AllowDevicesCheckBox.Location = new System.Drawing.Point(6, 84); this.AllowDevicesCheckBox.Name = "AllowDevicesCheckBox"; this.AllowDevicesCheckBox.Size = new System.Drawing.Size(206, 21); - this.AllowDevicesCheckBox.TabIndex = 6; + this.AllowDevicesCheckBox.TabIndex = 4; this.AllowDevicesCheckBox.Text = "Allow other Devices to connect"; this.AllowDevicesCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.AllowDevicesCheckBox.UseVisualStyleBackColor = true; @@ -340,7 +339,7 @@ namespace Netch.Forms this.LanguageLabel.Location = new System.Drawing.Point(15, 260); this.LanguageLabel.Name = "LanguageLabel"; this.LanguageLabel.Size = new System.Drawing.Size(65, 17); - this.LanguageLabel.TabIndex = 15; + this.LanguageLabel.TabIndex = 13; this.LanguageLabel.Text = "Language"; // // LanguageComboBox @@ -350,12 +349,18 @@ namespace Netch.Forms this.LanguageComboBox.Location = new System.Drawing.Point(182, 257); this.LanguageComboBox.Name = "LanguageComboBox"; this.LanguageComboBox.Size = new System.Drawing.Size(110, 25); - this.LanguageComboBox.TabIndex = 16; + this.LanguageComboBox.TabIndex = 14; // // NFTabPage // this.NFTabPage.BackColor = System.Drawing.SystemColors.ButtonFace; - this.NFTabPage.Controls.Add(this.groupBox1); + this.NFTabPage.Controls.Add(this.ProcessFilterProtocolLabel); + this.NFTabPage.Controls.Add(this.ProcessFilterProtocolComboBox); + this.NFTabPage.Controls.Add(this.DNSHijackCheckBox); + this.NFTabPage.Controls.Add(this.DNSHijackHostTextBox); + this.NFTabPage.Controls.Add(this.FilterICMPCheckBox); + this.NFTabPage.Controls.Add(this.ICMPDelayLabel); + this.NFTabPage.Controls.Add(this.ICMPDelayTextBox); this.NFTabPage.Controls.Add(this.RedirectorSSCheckBox); this.NFTabPage.Controls.Add(this.ChildProcessHandleCheckBox); this.NFTabPage.Location = new System.Drawing.Point(4, 29); @@ -365,42 +370,28 @@ namespace Netch.Forms this.NFTabPage.TabIndex = 1; this.NFTabPage.Text = "Process Mode"; // - // groupBox1 + // ProcessFilterProtocolLabel // - this.groupBox1.Controls.Add(this.ProcessProxyProtocolLabel); - this.groupBox1.Controls.Add(this.ProcessProxyProtocolComboBox); - this.groupBox1.Controls.Add(this.DNSHijackCheckBox); - this.groupBox1.Controls.Add(this.DNSHijackHostTextBox); - this.groupBox1.Controls.Add(this.ICMPHijackCheckBox); - this.groupBox1.Controls.Add(this.ICMPHijackHostTextBox); - this.groupBox1.Location = new System.Drawing.Point(5, 6); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(450, 117); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; + this.ProcessFilterProtocolLabel.AutoSize = true; + this.ProcessFilterProtocolLabel.Location = new System.Drawing.Point(30, 20); + this.ProcessFilterProtocolLabel.Name = "ProcessFilterProtocolLabel"; + this.ProcessFilterProtocolLabel.Size = new System.Drawing.Size(89, 17); + this.ProcessFilterProtocolLabel.TabIndex = 0; + this.ProcessFilterProtocolLabel.Text = "Filter Protocol"; // - // ProcessProxyProtocolLabel + // ProcessFilterProtocolComboBox // - this.ProcessProxyProtocolLabel.AutoSize = true; - this.ProcessProxyProtocolLabel.Location = new System.Drawing.Point(23, 21); - this.ProcessProxyProtocolLabel.Name = "ProcessProxyProtocolLabel"; - this.ProcessProxyProtocolLabel.Size = new System.Drawing.Size(93, 17); - this.ProcessProxyProtocolLabel.TabIndex = 0; - this.ProcessProxyProtocolLabel.Text = "Proxy Protocol"; - // - // ProcessProxyProtocolComboBox - // - this.ProcessProxyProtocolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ProcessProxyProtocolComboBox.FormattingEnabled = true; - this.ProcessProxyProtocolComboBox.Location = new System.Drawing.Point(118, 16); - this.ProcessProxyProtocolComboBox.Name = "ProcessProxyProtocolComboBox"; - this.ProcessProxyProtocolComboBox.Size = new System.Drawing.Size(191, 25); - this.ProcessProxyProtocolComboBox.TabIndex = 1; + this.ProcessFilterProtocolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.ProcessFilterProtocolComboBox.FormattingEnabled = true; + this.ProcessFilterProtocolComboBox.Location = new System.Drawing.Point(237, 17); + this.ProcessFilterProtocolComboBox.Name = "ProcessFilterProtocolComboBox"; + this.ProcessFilterProtocolComboBox.Size = new System.Drawing.Size(98, 25); + this.ProcessFilterProtocolComboBox.TabIndex = 1; // // DNSHijackCheckBox // this.DNSHijackCheckBox.AutoSize = true; - this.DNSHijackCheckBox.Location = new System.Drawing.Point(6, 51); + this.DNSHijackCheckBox.Location = new System.Drawing.Point(15, 50); this.DNSHijackCheckBox.Name = "DNSHijackCheckBox"; this.DNSHijackCheckBox.Size = new System.Drawing.Size(196, 21); this.DNSHijackCheckBox.TabIndex = 2; @@ -410,51 +401,58 @@ namespace Netch.Forms // DNSHijackHostTextBox // this.DNSHijackHostTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.DNSHijackCheckBox, "Checked", true)); - this.DNSHijackHostTextBox.Location = new System.Drawing.Point(253, 46); + this.DNSHijackHostTextBox.Location = new System.Drawing.Point(237, 48); this.DNSHijackHostTextBox.Name = "DNSHijackHostTextBox"; this.DNSHijackHostTextBox.Size = new System.Drawing.Size(191, 23); - this.DNSHijackHostTextBox.TabIndex = 4; + this.DNSHijackHostTextBox.TabIndex = 3; this.DNSHijackHostTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // - // ICMPHijackCheckBox + // FilterICMPCheckBox // - this.ICMPHijackCheckBox.AutoSize = true; - this.ICMPHijackCheckBox.Enabled = false; - this.ICMPHijackCheckBox.Location = new System.Drawing.Point(6, 81); - this.ICMPHijackCheckBox.Name = "ICMPHijackCheckBox"; - this.ICMPHijackCheckBox.Size = new System.Drawing.Size(139, 21); - this.ICMPHijackCheckBox.TabIndex = 5; - this.ICMPHijackCheckBox.Text = "Global ICMP Hijack"; - this.ICMPHijackCheckBox.UseVisualStyleBackColor = true; + this.FilterICMPCheckBox.AutoSize = true; + this.FilterICMPCheckBox.Location = new System.Drawing.Point(13, 80); + this.FilterICMPCheckBox.Name = "FilterICMPCheckBox"; + this.FilterICMPCheckBox.Size = new System.Drawing.Size(90, 21); + this.FilterICMPCheckBox.TabIndex = 4; + this.FilterICMPCheckBox.Text = "Filter ICMP"; + this.FilterICMPCheckBox.UseVisualStyleBackColor = true; // - // ICMPHijackHostTextBox + // ICMPDelayLabel // - this.ICMPHijackHostTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.ICMPHijackCheckBox, "Checked", true)); - this.ICMPHijackHostTextBox.Enabled = false; - this.ICMPHijackHostTextBox.Location = new System.Drawing.Point(253, 78); - this.ICMPHijackHostTextBox.Name = "ICMPHijackHostTextBox"; - this.ICMPHijackHostTextBox.Size = new System.Drawing.Size(191, 23); - this.ICMPHijackHostTextBox.TabIndex = 7; - this.ICMPHijackHostTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.ICMPDelayLabel.AutoSize = true; + this.ICMPDelayLabel.Location = new System.Drawing.Point(30, 110); + this.ICMPDelayLabel.Name = "ICMPDelayLabel"; + this.ICMPDelayLabel.Size = new System.Drawing.Size(100, 17); + this.ICMPDelayLabel.TabIndex = 5; + this.ICMPDelayLabel.Text = "ICMP Delay(ms)"; + // + // ICMPDelayTextBox + // + this.ICMPDelayTextBox.Location = new System.Drawing.Point(237, 107); + this.ICMPDelayTextBox.Name = "ICMPDelayTextBox"; + this.ICMPDelayTextBox.ReadOnly = true; + this.ICMPDelayTextBox.Size = new System.Drawing.Size(98, 23); + this.ICMPDelayTextBox.TabIndex = 6; + this.ICMPDelayTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // RedirectorSSCheckBox // this.RedirectorSSCheckBox.AutoSize = true; - this.RedirectorSSCheckBox.Location = new System.Drawing.Point(11, 129); + this.RedirectorSSCheckBox.Location = new System.Drawing.Point(15, 140); this.RedirectorSSCheckBox.Name = "RedirectorSSCheckBox"; - this.RedirectorSSCheckBox.Size = new System.Drawing.Size(106, 21); - this.RedirectorSSCheckBox.TabIndex = 1; - this.RedirectorSSCheckBox.Text = "Redirector SS"; + this.RedirectorSSCheckBox.Size = new System.Drawing.Size(265, 21); + this.RedirectorSSCheckBox.TabIndex = 7; + this.RedirectorSSCheckBox.Text = "Redirector built-in Shadowsocks support"; this.RedirectorSSCheckBox.UseVisualStyleBackColor = true; // // ChildProcessHandleCheckBox // this.ChildProcessHandleCheckBox.AutoSize = true; this.ChildProcessHandleCheckBox.Enabled = false; - this.ChildProcessHandleCheckBox.Location = new System.Drawing.Point(11, 151); + this.ChildProcessHandleCheckBox.Location = new System.Drawing.Point(15, 170); this.ChildProcessHandleCheckBox.Name = "ChildProcessHandleCheckBox"; this.ChildProcessHandleCheckBox.Size = new System.Drawing.Size(150, 21); - this.ChildProcessHandleCheckBox.TabIndex = 2; + this.ChildProcessHandleCheckBox.TabIndex = 8; this.ChildProcessHandleCheckBox.Text = "Child Process Handle"; this.ChildProcessHandleCheckBox.UseVisualStyleBackColor = true; // @@ -872,12 +870,12 @@ namespace Netch.Forms // // AioDNSTabPage // - this.AioDNSTabPage.Controls.Add(this.AioDNSListenPortLabel); - this.AioDNSTabPage.Controls.Add(this.AioDNSListenPortTextBox); this.AioDNSTabPage.Controls.Add(this.ChinaDNSLabel); this.AioDNSTabPage.Controls.Add(this.ChinaDNSTextBox); this.AioDNSTabPage.Controls.Add(this.OtherDNSLabel); this.AioDNSTabPage.Controls.Add(this.OtherDNSTextBox); + this.AioDNSTabPage.Controls.Add(this.AioDNSListenPortLabel); + this.AioDNSTabPage.Controls.Add(this.AioDNSListenPortTextBox); this.AioDNSTabPage.Location = new System.Drawing.Point(4, 29); this.AioDNSTabPage.Name = "AioDNSTabPage"; this.AioDNSTabPage.Padding = new System.Windows.Forms.Padding(3); @@ -886,30 +884,13 @@ namespace Netch.Forms this.AioDNSTabPage.Text = "AioDNS"; this.AioDNSTabPage.UseVisualStyleBackColor = true; // - // AioDNSListenPortLabel - // - this.AioDNSListenPortLabel.AutoSize = true; - this.AioDNSListenPortLabel.Location = new System.Drawing.Point(15, 103); - this.AioDNSListenPortLabel.Name = "AioDNSListenPortLabel"; - this.AioDNSListenPortLabel.Size = new System.Drawing.Size(69, 17); - this.AioDNSListenPortLabel.TabIndex = 0; - this.AioDNSListenPortLabel.Text = "Listen Port"; - // - // AioDNSListenPortTextBox - // - this.AioDNSListenPortTextBox.Location = new System.Drawing.Point(150, 100); - this.AioDNSListenPortTextBox.Name = "AioDNSListenPortTextBox"; - this.AioDNSListenPortTextBox.Size = new System.Drawing.Size(80, 23); - this.AioDNSListenPortTextBox.TabIndex = 1; - this.AioDNSListenPortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // // ChinaDNSLabel // this.ChinaDNSLabel.AutoSize = true; this.ChinaDNSLabel.Location = new System.Drawing.Point(15, 23); this.ChinaDNSLabel.Name = "ChinaDNSLabel"; this.ChinaDNSLabel.Size = new System.Drawing.Size(70, 17); - this.ChinaDNSLabel.TabIndex = 2; + this.ChinaDNSLabel.TabIndex = 0; this.ChinaDNSLabel.Text = "China DNS"; // // ChinaDNSTextBox @@ -917,7 +898,7 @@ namespace Netch.Forms this.ChinaDNSTextBox.Location = new System.Drawing.Point(150, 20); this.ChinaDNSTextBox.Name = "ChinaDNSTextBox"; this.ChinaDNSTextBox.Size = new System.Drawing.Size(201, 23); - this.ChinaDNSTextBox.TabIndex = 3; + this.ChinaDNSTextBox.TabIndex = 1; this.ChinaDNSTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // OtherDNSLabel @@ -926,7 +907,7 @@ namespace Netch.Forms this.OtherDNSLabel.Location = new System.Drawing.Point(15, 63); this.OtherDNSLabel.Name = "OtherDNSLabel"; this.OtherDNSLabel.Size = new System.Drawing.Size(71, 17); - this.OtherDNSLabel.TabIndex = 4; + this.OtherDNSLabel.TabIndex = 2; this.OtherDNSLabel.Text = "Other DNS"; // // OtherDNSTextBox @@ -934,9 +915,26 @@ namespace Netch.Forms this.OtherDNSTextBox.Location = new System.Drawing.Point(150, 60); this.OtherDNSTextBox.Name = "OtherDNSTextBox"; this.OtherDNSTextBox.Size = new System.Drawing.Size(201, 23); - this.OtherDNSTextBox.TabIndex = 5; + this.OtherDNSTextBox.TabIndex = 3; this.OtherDNSTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // + // AioDNSListenPortLabel + // + this.AioDNSListenPortLabel.AutoSize = true; + this.AioDNSListenPortLabel.Location = new System.Drawing.Point(15, 103); + this.AioDNSListenPortLabel.Name = "AioDNSListenPortLabel"; + this.AioDNSListenPortLabel.Size = new System.Drawing.Size(69, 17); + this.AioDNSListenPortLabel.TabIndex = 4; + this.AioDNSListenPortLabel.Text = "Listen Port"; + // + // AioDNSListenPortTextBox + // + this.AioDNSListenPortTextBox.Location = new System.Drawing.Point(150, 100); + this.AioDNSListenPortTextBox.Name = "AioDNSListenPortTextBox"; + this.AioDNSListenPortTextBox.Size = new System.Drawing.Size(80, 23); + this.AioDNSListenPortTextBox.TabIndex = 5; + this.AioDNSListenPortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // // ControlButton // this.ControlButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -982,8 +980,6 @@ namespace Netch.Forms this.PortGroupBox.PerformLayout(); this.NFTabPage.ResumeLayout(false); this.NFTabPage.PerformLayout(); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); this.WinTUNTabPage.ResumeLayout(false); this.WinTUNGroupBox.ResumeLayout(false); this.WinTUNGroupBox.PerformLayout(); @@ -1078,11 +1074,11 @@ namespace Netch.Forms private System.Windows.Forms.Label ServerPingTypeLabel; private System.Windows.Forms.RadioButton TCPingRadioBtn; private System.Windows.Forms.RadioButton ICMPingRadioBtn; - private System.Windows.Forms.ComboBox ProcessProxyProtocolComboBox; - private System.Windows.Forms.Label ProcessProxyProtocolLabel; - private System.Windows.Forms.CheckBox ICMPHijackCheckBox; + private System.Windows.Forms.ComboBox ProcessFilterProtocolComboBox; + private System.Windows.Forms.Label ProcessFilterProtocolLabel; + private System.Windows.Forms.CheckBox FilterICMPCheckBox; private System.Windows.Forms.CheckBox ChildProcessHandleCheckBox; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.TextBox ICMPHijackHostTextBox; + private System.Windows.Forms.TextBox ICMPDelayTextBox; + private System.Windows.Forms.Label ICMPDelayLabel; } } \ No newline at end of file diff --git a/Netch/Forms/SettingForm.cs b/Netch/Forms/SettingForm.cs index 3a71aca5..59cbda36 100644 --- a/Netch/Forms/SettingForm.cs +++ b/Netch/Forms/SettingForm.cs @@ -64,7 +64,7 @@ namespace Netch.Forms } catch (Exception e) { - Log.Warning(e,"Load stun.txt failed"); + Log.Warning(e, "Load stun.txt failed"); stuns = null; } @@ -99,16 +99,18 @@ namespace Netch.Forms #region Process Mode + BindListComboBox(ProcessFilterProtocolComboBox, + s => Global.Settings.Redirector.FilterProtocol = (PortType)Enum.Parse(typeof(PortType), s.ToString(), false), + Enum.GetNames(typeof(PortType)), + Global.Settings.Redirector.FilterProtocol.ToString()); + BindCheckBox(DNSHijackCheckBox, b => Global.Settings.Redirector.DNSHijack = b, Global.Settings.Redirector.DNSHijack); BindTextBox(DNSHijackHostTextBox, s => true, s => Global.Settings.Redirector.DNSHijackHost = s, Global.Settings.Redirector.DNSHijackHost); - BindCheckBox(ICMPHijackCheckBox, b => Global.Settings.Redirector.ICMPHijack = b, Global.Settings.Redirector.ICMPHijack); + BindCheckBox(FilterICMPCheckBox, b => Global.Settings.Redirector.FilterICMP = b, Global.Settings.Redirector.FilterICMP); - BindTextBox(ICMPHijackHostTextBox, - s => IPAddress.TryParse(s, out _), - s => Global.Settings.Redirector.ICMPHost = s, - Global.Settings.Redirector.ICMPHost); + BindTextBox(ICMPDelayTextBox, s => int.TryParse(s, out _), s => { }, Global.Settings.Redirector.ICMPDelay); BindCheckBox(RedirectorSSCheckBox, s => Global.Settings.Redirector.RedirectorSS = s, Global.Settings.Redirector.RedirectorSS); @@ -116,11 +118,6 @@ namespace Netch.Forms s => Global.Settings.Redirector.ChildProcessHandle = s, Global.Settings.Redirector.ChildProcessHandle); - BindListComboBox(ProcessProxyProtocolComboBox, - s => Global.Settings.Redirector.ProxyProtocol = (PortType)Enum.Parse(typeof(PortType), s.ToString(), false), - Enum.GetNames(typeof(PortType)), - Global.Settings.Redirector.ProxyProtocol.ToString()); - #endregion #region TUN/TAP diff --git a/Netch/Models/Mode.cs b/Netch/Models/Mode.cs index cb19886c..d8979970 100644 --- a/Netch/Models/Mode.cs +++ b/Netch/Models/Mode.cs @@ -126,7 +126,7 @@ namespace Netch.Models /// 是否会转发 UDP public static bool TestNatRequired(this Mode mode) { - return mode.Type is ModeType.Process && Global.Settings.Redirector.ProxyProtocol.HasFlag(PortType.UDP) || + return mode.Type is ModeType.Process && Global.Settings.Redirector.FilterProtocol.HasFlag(PortType.UDP) || mode.Type is ModeType.BypassRuleIPs; } } diff --git a/Netch/Models/Setting.cs b/Netch/Models/Setting.cs index 9353e78c..bc14c2f4 100644 --- a/Netch/Models/Setting.cs +++ b/Netch/Models/Setting.cs @@ -1,5 +1,6 @@ using Netch.Utils; using System.Collections.Generic; +using System.Text.Json.Serialization; namespace Netch.Models { @@ -88,7 +89,7 @@ namespace Netch.Models /// /// 不代理TCP /// - public PortType ProxyProtocol { get; set; } = PortType.Both; + public PortType FilterProtocol { get; set; } = PortType.Both; /// /// 是否开启DNS转发 @@ -100,9 +101,10 @@ namespace Netch.Models /// public string DNSHijackHost { get; set; } = "1.1.1.1:53"; - public string ICMPHost { get; set; } = "1.2.4.8"; + [JsonIgnore] + public int ICMPDelay { get; } = 0; - public bool ICMPHijack { get; set; } = false; + public bool FilterICMP { get; set; } = false; /// /// 是否使用RDR内置SS diff --git a/Netch/Resources/zh-CN b/Netch/Resources/zh-CN index f6906a25..42b828fa 100644 --- a/Netch/Resources/zh-CN +++ b/Netch/Resources/zh-CN @@ -148,10 +148,11 @@ "Check update when opened": "打开软件时检查更新", "Check Beta update": "检查 Beta 更新", "Update Servers when opened": "打开软件时更新服务器", - "Proxy Protocol": "代理协议", + "Filter Protocol": "Filter 协议", "Handle process's DNS Hijack": "被代理进程 DNS 劫持", - "Global ICMP Hijack": "全局 ICMP 劫持", "Child Process Handle": "子进程代理", + "ICMP Delay(ms)": "ICMP 延迟(毫秒)", + "Redirector built-in Shadowsocks support": "Redirector 内建 Shadowsocks 支持", "Profile Count": "快捷配置数量", "Delay test after start(sec)": "启动后延迟测试(秒)", "Ping Protocol": "延迟测试协议",