From 5f7feac85c6c588cceb0e32f4d67905d751eda3e Mon Sep 17 00:00:00 2001 From: YohoYang Date: Fri, 21 Oct 2022 00:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E7=94=9F=E6=95=88=E7=9A=84socks=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/v2rayN/Forms/MainMsgControl.cs | 6 + .../Forms/OptionSettingForm.Designer.cs | 19 +- v2rayN/v2rayN/Forms/OptionSettingForm.cs | 3 + v2rayN/v2rayN/Forms/OptionSettingForm.resx | 1804 +++++++++-------- .../Forms/OptionSettingForm.zh-Hans.resx | 518 ++--- v2rayN/v2rayN/Global.cs | 1 + v2rayN/v2rayN/Handler/V2rayConfigHandler.cs | 17 + v2rayN/v2rayN/Mode/Config.cs | 6 + v2rayN/v2rayN/Properties/Settings.Designer.cs | 2 +- v2rayN/v2rayN/Resx/ResUI.Designer.cs | 13 +- v2rayN/v2rayN/Resx/ResUI.resx | 3 + v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx | 3 + 12 files changed, 1239 insertions(+), 1156 deletions(-) diff --git a/v2rayN/v2rayN/Forms/MainMsgControl.cs b/v2rayN/v2rayN/Forms/MainMsgControl.cs index 6696573c..944b7724 100644 --- a/v2rayN/v2rayN/Forms/MainMsgControl.cs +++ b/v2rayN/v2rayN/Forms/MainMsgControl.cs @@ -106,6 +106,12 @@ namespace v2rayN.Forms sb.Append($"[{Global.InboundHttp}:{config.GetLocalPort(Global.InboundHttp2)}]"); } + if (config.inbound[0].addGlobalProxyPort) + { + sb.Append($" {ResUI.LabLocalGlobal}:"); + sb.Append($"[{Global.InboundSocks}:{config.GetLocalPort(Global.InboundSocksG)}]"); + } + SetToolSslInfo("inbound", sb.ToString()); } diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs index 29189e81..dc14ff71 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs @@ -70,6 +70,7 @@ this.txtKcpmtu = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); this.tabPage7 = new System.Windows.Forms.TabPage(); + this.chkEnableCheckPreReleaseUpdate = new System.Windows.Forms.CheckBox(); this.numStatisticsFreshRate = new System.Windows.Forms.NumericUpDown(); this.txttrayMenuServersLimit = new System.Windows.Forms.TextBox(); this.label17 = new System.Windows.Forms.Label(); @@ -108,7 +109,7 @@ this.panel2 = new System.Windows.Forms.Panel(); this.btnOK = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); - this.chkEnableCheckPreReleaseUpdate = new System.Windows.Forms.CheckBox(); + this.chkaddGlobalProxyPort = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -151,6 +152,7 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.chkaddGlobalProxyPort); this.groupBox1.Controls.Add(this.label16); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.txtpass); @@ -422,6 +424,12 @@ this.tabPage7.Name = "tabPage7"; this.tabPage7.UseVisualStyleBackColor = true; // + // chkEnableCheckPreReleaseUpdate + // + resources.ApplyResources(this.chkEnableCheckPreReleaseUpdate, "chkEnableCheckPreReleaseUpdate"); + this.chkEnableCheckPreReleaseUpdate.Name = "chkEnableCheckPreReleaseUpdate"; + this.chkEnableCheckPreReleaseUpdate.UseVisualStyleBackColor = true; + // // numStatisticsFreshRate // resources.ApplyResources(this.numStatisticsFreshRate, "numStatisticsFreshRate"); @@ -658,11 +666,11 @@ resources.ApplyResources(this.panel1, "panel1"); this.panel1.Name = "panel1"; // - // chkEnableCheckPreReleaseUpdate + // chkaddGlobalProxyPort // - resources.ApplyResources(this.chkEnableCheckPreReleaseUpdate, "chkEnableCheckPreReleaseUpdate"); - this.chkEnableCheckPreReleaseUpdate.Name = "chkEnableCheckPreReleaseUpdate"; - this.chkEnableCheckPreReleaseUpdate.UseVisualStyleBackColor = true; + resources.ApplyResources(this.chkaddGlobalProxyPort, "chkaddGlobalProxyPort"); + this.chkaddGlobalProxyPort.Name = "chkaddGlobalProxyPort"; + this.chkaddGlobalProxyPort.UseVisualStyleBackColor = true; // // OptionSettingForm // @@ -778,5 +786,6 @@ private System.Windows.Forms.ComboBox cmbdomainStrategy4Freedom; private System.Windows.Forms.Label label19; private System.Windows.Forms.CheckBox chkEnableCheckPreReleaseUpdate; + private System.Windows.Forms.CheckBox chkaddGlobalProxyPort; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.cs index 9d6502ed..39d1066d 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.cs @@ -49,6 +49,7 @@ namespace v2rayN.Forms chkudpEnabled.Checked = config.inbound[0].udpEnabled; chksniffingEnabled.Checked = config.inbound[0].sniffingEnabled; chkAllowLANConn.Checked = config.inbound[0].allowLANConn; + chkaddGlobalProxyPort.Checked = config.inbound[0].addGlobalProxyPort; txtuser.Text = config.inbound[0].user; txtpass.Text = config.inbound[0].pass; @@ -183,6 +184,7 @@ namespace v2rayN.Forms bool udpEnabled = chkudpEnabled.Checked; bool sniffingEnabled = chksniffingEnabled.Checked; bool allowLANConn = chkAllowLANConn.Checked; + bool addGlobalProxyPort = chkaddGlobalProxyPort.Checked; if (Utils.IsNullOrEmpty(localPort) || !Utils.IsNumberic(localPort)) { UI.Show(ResUI.FillLocalListeningPort); @@ -213,6 +215,7 @@ namespace v2rayN.Forms config.inbound[0].udpEnabled = udpEnabled; config.inbound[0].sniffingEnabled = sniffingEnabled; config.inbound[0].allowLANConn = allowLANConn; + config.inbound[0].addGlobalProxyPort = addGlobalProxyPort; config.inbound[0].user = txtuser.Text; config.inbound[0].pass = txtpass.Text; diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.resx index c1cb6445..1cced2cd 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.resx @@ -143,6 +143,487 @@ 0 + + True + + + + NoControl + + + 15, 95 + + + 198, 16 + + + 40 + + + Add A global proxy socks port + + + chkaddGlobalProxyPort + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + True + + + NoControl + + + 397, 65 + + + 59, 12 + + + 39 + + + Auth pass + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + + + True + + + NoControl + + + 224, 65 + + + 59, 12 + + + 38 + + + Auth user + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + + + 496, 61 + + + 120, 21 + + + 37 + + + txtpass + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 3 + + + 285, 61 + + + 97, 21 + + + 36 + + + txtuser + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 4 + + + True + + + NoControl + + + 15, 211 + + + 102, 16 + + + 35 + + + allowInsecure + + + chkdefAllowInsecure + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 5 + + + True + + + 15, 63 + + + 204, 16 + + + 29 + + + Allow connections from the LAN + + + chkAllowLANConn + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 6 + + + True + + + NoControl + + + 496, 27 + + + 120, 16 + + + 31 + + + Turn on Sniffing + + + chksniffingEnabled + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 7 + + + True + + + 15, 148 + + + 174, 16 + + + 20 + + + Turn on Mux Multiplexing + + + chkmuxEnabled + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 8 + + + False + + + socks + + + http + + + 285, 25 + + + 97, 20 + + + 12 + + + cmbprotocol + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 9 + + + True + + + 224, 29 + + + 53, 12 + + + 11 + + + protocol + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 10 + + + True + + + 397, 27 + + + 84, 16 + + + 10 + + + Enable UDP + + + chkudpEnabled + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 11 + + + True + + + 15, 179 + + + 126, 16 + + + 9 + + + Record local logs + + + chklogEnabled + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 12 + + + debug + + + info + + + warning + + + error + + + none + + + 257, 177 + + + 97, 20 + + + 6 + + + cmbloglevel + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 13 + + + True + + + 193, 181 + + + 59, 12 + + + 8 + + + Log level + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 14 + + + 124, 25 + + + 78, 21 + + + 3 + + + txtlocalPort + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 15 + + + True + + + 33, 29 + + + 89, 12 + + + 2 + + + Listening port + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 16 + + + Fill + + + 3, 3 + + + 722, 421 + + + 6 + groupBox1 @@ -158,7 +639,6 @@ 4, 22 - 3, 3, 3, 3 @@ -450,21 +930,6 @@ 2 - - NoControl - - - 15, 247 - - - 297, 16 - - - 48 - - - Check for pre-release updates - chkEnableCheckPreReleaseUpdate @@ -477,15 +942,6 @@ 0 - - 663, 37 - - - 62, 21 - - - 47 - numStatisticsFreshRate @@ -498,15 +954,6 @@ 1 - - 351, 211 - - - 97, 21 - - - 45 - txttrayMenuServersLimit @@ -519,24 +966,6 @@ 2 - - True - - - NoControl - - - 27, 215 - - - 263, 12 - - - 44 - - - Tray right-click menu servers display limit - label17 @@ -549,15 +978,6 @@ 3 - - 351, 184 - - - 97, 21 - - - 43 - txtautoUpdateSubInterval @@ -570,24 +990,6 @@ 4 - - True - - - NoControl - - - 27, 188 - - - 305, 12 - - - 42 - - - Automatic update interval of subscriptions (hours) - label3 @@ -600,18 +1002,6 @@ 5 - - 15, 131 - - - 506, 16 - - - 41 - - - Enable Security Protocol TLS v1.3 (subscription/update/speedtest) - chkEnableSecurityProtocolTls13 @@ -624,24 +1014,6 @@ 6 - - True - - - NoControl - - - 15, 108 - - - 390, 16 - - - 40 - - - Automatically adjust column width after updating subscription - chkEnableAutoAdjustMainLvColWidth @@ -654,21 +1026,6 @@ 7 - - NoControl - - - 30, 376 - - - 282, 23 - - - 39 - - - Set Windows10 UWP Loopback - btnSetLoopback @@ -681,15 +1038,6 @@ 8 - - 351, 157 - - - 97, 21 - - - 38 - txtautoUpdateInterval @@ -702,24 +1050,6 @@ 9 - - True - - - NoControl - - - 27, 161 - - - 269, 12 - - - 37 - - - Automatic update interval of and Geo (hours) - label15 @@ -732,24 +1062,6 @@ 10 - - True - - - NoControl - - - 15, 85 - - - 234, 16 - - - 36 - - - Ignore Geo files when updating core - chkIgnoreGeoUpdateCore @@ -762,24 +1074,6 @@ 11 - - True - - - NoControl - - - 15, 62 - - - 198, 16 - - - 33 - - - Keep older when deduplication - chkKeepOlderDedupl @@ -792,24 +1086,6 @@ 12 - - True - - - NoControl - - - 479, 41 - - - 179, 12 - - - 30 - - - Statistics freshrate (second) - lbFreshrate @@ -822,24 +1098,6 @@ 13 - - True - - - NoControl - - - 15, 39 - - - 468, 16 - - - 29 - - - Enable Statistics (Realtime netspeed and traffic records. Require restart) - chkEnableStatistics @@ -852,21 +1110,6 @@ 14 - - True - - - 15, 16 - - - 246, 16 - - - 23 - - - Automatically start at system startup - chkAutoRun @@ -1137,660 +1380,6 @@ 0 - - label16 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 1 - - - txtpass - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 2 - - - txtuser - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 3 - - - chkdefAllowInsecure - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 4 - - - chkAllowLANConn - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 5 - - - chksniffingEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 6 - - - chkmuxEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 7 - - - cmbprotocol - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 8 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 9 - - - chkudpEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 10 - - - chklogEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 11 - - - cmbloglevel - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 12 - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 13 - - - txtlocalPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 14 - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 15 - - - Fill - - - 3, 3 - - - 722, 421 - - - 6 - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage1 - - - 0 - - - True - - - NoControl - - - 397, 65 - - - 59, 12 - - - 39 - - - Auth pass - - - label16 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - True - - - NoControl - - - 224, 65 - - - 59, 12 - - - 38 - - - Auth user - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 1 - - - 496, 61 - - - 120, 21 - - - 37 - - - txtpass - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 2 - - - 285, 61 - - - 97, 21 - - - 36 - - - txtuser - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 3 - - - True - - - NoControl - - - 15, 192 - - - 102, 16 - - - 35 - - - allowInsecure - - - chkdefAllowInsecure - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 4 - - - True - - - 15, 63 - - - 204, 16 - - - 29 - - - Allow connections from the LAN - - - chkAllowLANConn - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 5 - - - True - - - NoControl - - - 496, 27 - - - 120, 16 - - - 31 - - - Turn on Sniffing - - - chksniffingEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 6 - - - True - - - 15, 129 - - - 174, 16 - - - 20 - - - Turn on Mux Multiplexing - - - chkmuxEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 7 - - - False - - - socks - - - http - - - 285, 25 - - - 97, 20 - - - 12 - - - cmbprotocol - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 8 - - - True - - - 224, 29 - - - 53, 12 - - - 11 - - - protocol - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 9 - - - True - - - 397, 27 - - - 84, 16 - - - 10 - - - Enable UDP - - - chkudpEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 10 - - - True - - - 15, 160 - - - 126, 16 - - - 9 - - - Record local logs - - - chklogEnabled - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 11 - - - debug - - - info - - - warning - - - error - - - none - - - 257, 158 - - - 97, 20 - - - 6 - - - cmbloglevel - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 12 - - - True - - - 193, 162 - - - 59, 12 - - - 8 - - - Log level - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 13 - - - 124, 25 - - - 78, 21 - - - 3 - - - txtlocalPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 14 - - - True - - - 33, 29 - - - 89, 12 - - - 2 - - - Listening port - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 15 - AsIs @@ -2259,6 +1848,435 @@ 12 + + NoControl + + + 15, 247 + + + 297, 16 + + + 48 + + + Check for pre-release updates + + + chkEnableCheckPreReleaseUpdate + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 0 + + + 663, 37 + + + 62, 21 + + + 47 + + + numStatisticsFreshRate + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 1 + + + 351, 211 + + + 97, 21 + + + 45 + + + txttrayMenuServersLimit + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 2 + + + True + + + NoControl + + + 27, 215 + + + 263, 12 + + + 44 + + + Tray right-click menu servers display limit + + + label17 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 3 + + + 351, 184 + + + 97, 21 + + + 43 + + + txtautoUpdateSubInterval + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 4 + + + True + + + NoControl + + + 27, 188 + + + 305, 12 + + + 42 + + + Automatic update interval of subscriptions (hours) + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 5 + + + 15, 131 + + + 506, 16 + + + 41 + + + Enable Security Protocol TLS v1.3 (subscription/update/speedtest) + + + chkEnableSecurityProtocolTls13 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 6 + + + True + + + NoControl + + + 15, 108 + + + 390, 16 + + + 40 + + + Automatically adjust column width after updating subscription + + + chkEnableAutoAdjustMainLvColWidth + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 7 + + + NoControl + + + 30, 376 + + + 282, 23 + + + 39 + + + Set Windows10 UWP Loopback + + + btnSetLoopback + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 8 + + + 351, 157 + + + 97, 21 + + + 38 + + + txtautoUpdateInterval + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 9 + + + True + + + NoControl + + + 27, 161 + + + 269, 12 + + + 37 + + + Automatic update interval of and Geo (hours) + + + label15 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 10 + + + True + + + NoControl + + + 15, 85 + + + 234, 16 + + + 36 + + + Ignore Geo files when updating core + + + chkIgnoreGeoUpdateCore + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 11 + + + True + + + NoControl + + + 15, 62 + + + 198, 16 + + + 33 + + + Keep older when deduplication + + + chkKeepOlderDedupl + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 12 + + + True + + + NoControl + + + 479, 41 + + + 179, 12 + + + 30 + + + Statistics freshrate (second) + + + lbFreshrate + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 13 + + + True + + + NoControl + + + 15, 39 + + + 468, 16 + + + 29 + + + Enable Statistics (Realtime netspeed and traffic records. Require restart) + + + chkEnableStatistics + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 14 + + + True + + + 15, 16 + + + 246, 16 + + + 23 + + + Automatically start at system startup + + + chkAutoRun + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage7 + + + 15 + 117, 172 @@ -2893,6 +2911,6 @@ OptionSettingForm - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + v2rayN.Forms.BaseForm, v2rayN, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx index 7434452d..119ab197 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx @@ -1,6 +1,6 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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) - - - 662, 469 - - - 654, 443 - - + + + 662, 469 + + + 654, 443 + + Core:基础设置 - - 648, 437 - - - 53, 12 - - + + 648, 437 + + + 53, 12 + + 认证密码 - - 219, 65 - - - 65, 12 - - + + 219, 65 + + + 65, 12 + + 认证用户名 - - 15, 208 - - - 324, 16 - - + + 15, 208 + + + 324, 16 + + 传输层安全选tls时,默认跳过证书验证(allowInsecure) - - 144, 16 - - + + 144, 16 + + 允许来自局域网的连接 - - 96, 16 + + 144, 16 + + + 增加一个本地全局socks端口 - + + 144, 16 + + 开启流量探测 - - 15, 145 - - - 114, 16 - - + + 15, 145 + + + 114, 16 + + 开启Mux多路复用 - - 219, 29 - - - 29, 12 - - + + 219, 29 + + + 29, 12 + + 协议 - - 66, 16 - - + + 66, 16 + + 开启UDP - - 15, 176 - - - 156, 16 - - + + 15, 176 + + + 156, 16 + + 记录本地日志(默认关闭) - - 257, 174 - - - 193, 178 - - - 53, 12 - - + + 257, 174 + + + 193, 178 + + + 53, 12 + + 日志等级 - - 77, 12 - - + + 77, 12 + + 本地监听端口 - - 654, 443 - - + + 654, 443 + + Core:DNS设置 - - 223, 413 - - - 8, 417 - - - 161, 12 - - + + 223, 413 + + + 8, 417 + + + 161, 12 + + 支持填写DnsObject,JSON格式 - - 638, 366 - - - 191, 12 - - + + 638, 366 + + + 191, 12 + + 自定义DNS(可多个,用逗号(,)隔开) - - 654, 443 - - + + 654, 443 + + Core:KCP设置 - - 654, 443 - - + + 654, 443 + + v2rayN设置 - - 472, 37 - - - 248, 211 - - - 185, 12 - - + + 472, 37 + + + 248, 211 + + + 185, 12 + + 托盘右键菜单服务器展示数量限制 - - 248, 184 - - - 173, 12 - - + + 248, 184 + + + 173, 12 + + 自动更新订阅的间隔(单位小时) - + 启用安全协议TLS v1.3 (订阅/检查更新/测速) - - 204, 16 - - + + 204, 16 + + 自动调整服务器列宽在更新订阅后 - + 解除Windows10 UWP应用回环代理限制 - - 248, 157 - - - 191, 12 - - + + 248, 157 + + + 191, 12 + + 自动更新Geo文件的间隔(单位小时) - - 150, 16 - - + + 150, 16 + + 更新Core时忽略Geo文件 - - 156, 16 - - + + 156, 16 + + 去重时保留序号较小的项 - - 339, 41 - - - 125, 12 - - + + 339, 41 + + + 125, 12 + + 统计刷新频率(单位秒) - - 300, 16 - - + + 300, 16 + + 启用统计(实时网速显示和使用流量显示,需要重启) - - 180, 16 - - + + 180, 16 + + 开机自动启动(可能会不成功) - - 654, 443 - - + + 654, 443 + + Core类型设置 - - 654, 443 - - + + 654, 443 + + 系统代理设置 - - 654, 443 - - + + 654, 443 + + 例外 - - 173, 12 - - + + 173, 12 + + 高级代理设置, 协议选择(可选) - - 95, 12 - - + + 95, 12 + + 使用分号(;)分隔 - - 239, 12 - - + + 239, 12 + + 对于下列字符开头的地址不使用代理服务器: - - 0, 479 - - - 662, 60 - - + + 0, 479 + + + 662, 60 + + 确定(&O) - - 662, 10 - - - 662, 539 - - + + 662, 10 + + + 662, 539 + + 参数设置 - + 检查Pre-Release更新(请谨慎启用) \ No newline at end of file diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 1c8fe14c..74825f61 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -120,6 +120,7 @@ namespace v2rayN public const string InboundHttp = "http"; public const string InboundSocks2 = "socks2"; public const string InboundHttp2 = "http2"; + public const string InboundSocksG = "socksG"; public const string Loopback = "127.0.0.1"; public const string InboundAPITagName = "api"; public const string InboundAPIProtocal = "dokodemo-door"; diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index c5062f9b..17f073e1 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -156,6 +156,12 @@ namespace v2rayN.Handler inbound4.settings.accounts = new List { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; } } + + if (config.inbound[0].addGlobalProxyPort) + { + Inbounds inbound5 = GetInbound(config.inbound[0], Global.InboundSocksG, 4, true); + v2rayConfig.inbounds.Add(inbound5); + } } catch (Exception ex) { @@ -202,6 +208,17 @@ namespace v2rayN.Handler v2rayConfig.routing.domainStrategy = config.domainStrategy; v2rayConfig.routing.domainMatcher = Utils.IsNullOrEmpty(config.domainMatcher) ? null : config.domainMatcher; + if (config.inbound[0].addGlobalProxyPort) + { + var item = new RulesItem(); + var inTag = new List(); + inTag.Add("socksG"); + item.type = "field"; + item.inboundTag = inTag; + item.outboundTag = "proxy"; + v2rayConfig.routing.rules.Add(item); + } + if (config.enableRoutingAdvanced) { if (config.routings != null && config.routingIndex < config.routings.Count) diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index 6349b123..6055617d 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -238,6 +238,10 @@ namespace v2rayN.Mode { return localPort + 3; } + else if (protocol == Global.InboundSocksG) + { + return localPort + 4; + } else if (protocol == "speedtest") { return localPort + 103; @@ -611,6 +615,8 @@ namespace v2rayN.Mode public bool allowLANConn { get; set; } + public bool addGlobalProxyPort { get; set; } + public string user { get; set; } public string pass { get; set; } diff --git a/v2rayN/v2rayN/Properties/Settings.Designer.cs b/v2rayN/v2rayN/Properties/Settings.Designer.cs index dea73b7b..93f22bec 100644 --- a/v2rayN/v2rayN/Properties/Settings.Designer.cs +++ b/v2rayN/v2rayN/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace v2rayN.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs index 80b79b1f..4da54cf0 100644 --- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs +++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs @@ -338,7 +338,18 @@ namespace v2rayN.Resx { return ResourceManager.GetString("LabLocal", resourceCulture); } } - + + /// + /// 查找类似 Local 的本地化字符串。 + /// + internal static string LabLocalGlobal + { + get + { + return ResourceManager.GetString("LabLocalGlobal", resourceCulture); + } + } + /// /// 查找类似 Address 的本地化字符串。 /// diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index a5d0f6da..cdeb1c4a 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -475,4 +475,7 @@ Normal use of this version requires .NET Framework 4.8 + + Global + \ No newline at end of file diff --git a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx index 6d42102b..a432f69c 100644 --- a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx @@ -475,4 +475,7 @@ 正常使用此版本需要.NET Framework 4.8,请更新后重启 + + 全局 + \ No newline at end of file