diff --git a/v2rayN/v2rayN/Forms/MainMsgControl.cs b/v2rayN/v2rayN/Forms/MainMsgControl.cs index 6696573c..2d51cfc0 100644 --- a/v2rayN/v2rayN/Forms/MainMsgControl.cs +++ b/v2rayN/v2rayN/Forms/MainMsgControl.cs @@ -100,10 +100,19 @@ namespace v2rayN.Forms if (config.inbound[0].allowLANConn) { + var inboudSocks2 = Global.InboundSocks2; + var inboudHttp2 = Global.InboundHttp2; + + if (config.inbound[0].useSamePortForLocalAndLan) + { + inboudSocks2 = Global.InboundSocks; + inboudHttp2 = Global.InboundHttp; + } + sb.Append($" {ResUI.LabLAN}:"); - sb.Append($"[{Global.InboundSocks}:{config.GetLocalPort(Global.InboundSocks2)}]"); + sb.Append($"[{Global.InboundSocks}:{config.GetLocalPort(inboudSocks2)}]"); sb.Append(" | "); - sb.Append($"[{Global.InboundHttp}:{config.GetLocalPort(Global.InboundHttp2)}]"); + sb.Append($"[{Global.InboundHttp}:{config.GetLocalPort(inboudHttp2)}]"); } SetToolSslInfo("inbound", sb.ToString()); diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs index 29189e81..5342fca4 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.chkUseSamePortForLocalAndLan = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -155,6 +156,7 @@ this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.txtpass); this.groupBox1.Controls.Add(this.txtuser); + this.groupBox1.Controls.Add(this.chkUseSamePortForLocalAndLan); this.groupBox1.Controls.Add(this.chkdefAllowInsecure); this.groupBox1.Controls.Add(this.chkAllowLANConn); this.groupBox1.Controls.Add(this.chksniffingEnabled); @@ -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 + // chkUseSamePortForLocalAndLan // - resources.ApplyResources(this.chkEnableCheckPreReleaseUpdate, "chkEnableCheckPreReleaseUpdate"); - this.chkEnableCheckPreReleaseUpdate.Name = "chkEnableCheckPreReleaseUpdate"; - this.chkEnableCheckPreReleaseUpdate.UseVisualStyleBackColor = true; + resources.ApplyResources(this.chkUseSamePortForLocalAndLan, "chkUseSamePortForLocalAndLan"); + this.chkUseSamePortForLocalAndLan.Name = "chkUseSamePortForLocalAndLan"; + this.chkUseSamePortForLocalAndLan.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 chkUseSamePortForLocalAndLan; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.cs index 4c357b83..e9825535 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.cs @@ -53,7 +53,7 @@ namespace v2rayN.Forms chkAllowLANConn.Checked = config.inbound[0].allowLANConn; txtuser.Text = config.inbound[0].user; txtpass.Text = config.inbound[0].pass; - + chkUseSamePortForLocalAndLan.Checked = config.inbound[0].useSamePortForLocalAndLan; } //remoteDNS @@ -185,6 +185,7 @@ namespace v2rayN.Forms bool udpEnabled = chkudpEnabled.Checked; bool sniffingEnabled = chksniffingEnabled.Checked; bool allowLANConn = chkAllowLANConn.Checked; + bool useSamePortForLocalAndLan = chkUseSamePortForLocalAndLan.Checked; if (Utils.IsNullOrEmpty(localPort) || !Utils.IsNumberic(localPort)) { UI.Show(ResUI.FillLocalListeningPort); @@ -215,6 +216,7 @@ namespace v2rayN.Forms config.inbound[0].udpEnabled = udpEnabled; config.inbound[0].sniffingEnabled = sniffingEnabled; config.inbound[0].allowLANConn = allowLANConn; + config.inbound[0].useSamePortForLocalAndLan = useSamePortForLocalAndLan; 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..12cd6d32 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.resx @@ -143,6 +143,487 @@ 0 + + True + + + + NoControl + + + 397, 65 + + + 54, 13 + + + 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 + + + 52, 13 + + + 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, 20 + + + 37 + + + txtpass + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + + + 285, 61 + + + 97, 20 + + + 36 + + + txtuser + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 3 + + + True + + + NoControl + + + 15, 96 + + + 186, 17 + + + 35 + + + Use Same Port for Local and LAN + + + chkUseSamePortForLocalAndLan + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 4 + + + True + + + NoControl + + + 15, 192 + + + 91, 17 + + + 35 + + + allowInsecure + + + chkdefAllowInsecure + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 5 + + + True + + + 15, 63 + + + 177, 17 + + + 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 + + + 101, 17 + + + 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, 129 + + + 147, 17 + + + 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, 21 + + + 12 + + + cmbprotocol + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 9 + + + True + + + 224, 29 + + + 45, 13 + + + 11 + + + protocol + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 10 + + + True + + + 397, 27 + + + 85, 17 + + + 10 + + + Enable UDP + + + chkudpEnabled + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 11 + + + True + + + 15, 160 + + + 108, 17 + + + 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, 158 + + + 97, 21 + + + 6 + + + cmbloglevel + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 13 + + + True + + + 193, 162 + + + 50, 13 + + + 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, 20 + + + 3 + + + txtlocalPort + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 15 + + + True + + + 33, 29 + + + 70, 13 + + + 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, 465 + + + 6 + groupBox1 @@ -158,12 +639,11 @@ 4, 22 - 3, 3, 3, 3 - 728, 427 + 728, 471 0 @@ -247,7 +727,7 @@ 4, 22 - 728, 427 + 728, 471 4 @@ -430,7 +910,7 @@ 3, 3, 3, 3 - 728, 427 + 728, 471 2 @@ -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 @@ -886,7 +1129,7 @@ 3, 3, 3, 3 - 728, 427 + 728, 471 3 @@ -1057,7 +1300,7 @@ 3, 3, 3, 3 - 728, 427 + 728, 471 6 @@ -1093,7 +1336,7 @@ 4, 22 - 728, 427 + 728, 471 5 @@ -1120,7 +1363,7 @@ 0, 10 - 736, 453 + 736, 497 10 @@ -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 @@ -1807,23 +1396,11 @@ 223, 398 - 100, 20 + 100, 21 41 - - cmbdomainStrategy4Freedom - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage2 - - - 0 - True @@ -1834,7 +1411,7 @@ 8, 402 - 191, 12 + 174, 13 42 @@ -1842,18 +1419,6 @@ Outbound Freedom domainStrategy - - label19 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage2 - - - 1 - True @@ -1867,7 +1432,7 @@ 0, 0, 0, 0 - 107, 12 + 97, 13 40 @@ -1875,18 +1440,6 @@ Support DnsObject - - linkDnsObjectDoc - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage2 - - - 2 - 8, 41 @@ -1902,18 +1455,6 @@ 39 - - txtremoteDNS - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage2 - - - 3 - True @@ -1924,7 +1465,7 @@ 8, 17 - 281, 12 + 233, 13 38 @@ -1932,18 +1473,6 @@ Custom DNS (multiple, separated by commas (,)) - - label14 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage2 - - - 4 - True @@ -1951,7 +1480,7 @@ 20, 143 - 84, 16 + 78, 17 20 @@ -1959,39 +1488,15 @@ congestion - - chkKcpcongestion - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 0 - 345, 100 - 94, 21 + 94, 20 15 - - txtKcpwriteBufferSize - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 1 - True @@ -1999,7 +1504,7 @@ 236, 104 - 95, 12 + 77, 13 14 @@ -2007,39 +1512,15 @@ writeBufferSize - - label10 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 2 - 111, 100 - 94, 21 + 94, 20 13 - - txtKcpreadBufferSize - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 3 - True @@ -2047,7 +1528,7 @@ 18, 104 - 89, 12 + 76, 13 12 @@ -2055,39 +1536,15 @@ readBufferSize - - label11 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 4 - 345, 62 - 94, 21 + 94, 20 11 - - txtKcpdownlinkCapacity - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 5 - True @@ -2095,7 +1552,7 @@ 236, 66 - 101, 12 + 90, 13 10 @@ -2103,39 +1560,15 @@ downlinkCapacity - - label8 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 6 - 111, 62 - 94, 21 + 94, 20 9 - - txtKcpuplinkCapacity - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 7 - True @@ -2143,7 +1576,7 @@ 18, 66 - 89, 12 + 76, 13 8 @@ -2151,39 +1584,15 @@ uplinkCapacity - - label9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 8 - 345, 24 - 94, 21 + 94, 20 7 - - txtKcptti - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 9 - True @@ -2191,7 +1600,7 @@ 236, 28 - 23, 12 + 15, 13 6 @@ -2199,39 +1608,15 @@ tti - - label7 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 10 - 111, 24 - 94, 21 + 94, 20 5 - - txtKcpmtu - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - 11 - True @@ -2239,7 +1624,7 @@ 18, 28 - 23, 12 + 24, 13 4 @@ -2247,39 +1632,252 @@ mtu - - label6 + + NoControl - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 15, 247 - - tabPage6 + + 297, 16 - - 12 + + 48 + + + Check for pre-release updates + + + 663, 37 + + + 62, 20 + + + 47 + + + 351, 211 + + + 97, 20 + + + 45 + + + True + + + NoControl + + + 27, 215 + + + 197, 13 + + + 44 + + + Tray right-click menu servers display limit + + + 351, 184 + + + 97, 20 + + + 43 + + + True + + + NoControl + + + 27, 188 + + + 238, 13 + + + 42 + + + Automatic update interval of subscriptions (hours) + + + 15, 131 + + + 506, 16 + + + 41 + + + Enable Security Protocol TLS v1.3 (subscription/update/speedtest) + + + True + + + NoControl + + + 15, 108 + + + 311, 17 + + + 40 + + + Automatically adjust column width after updating subscription + + + NoControl + + + 30, 376 + + + 282, 23 + + + 39 + + + Set Windows10 UWP Loopback + + + 351, 157 + + + 97, 20 + + + 38 + + + True + + + NoControl + + + 27, 161 + + + 218, 13 + + + 37 + + + Automatic update interval of and Geo (hours) + + + True + + + NoControl + + + 15, 85 + + + 197, 17 + + + 36 + + + Ignore Geo files when updating core + + + True + + + NoControl + + + 15, 62 + + + 172, 17 + + + 33 + + + Keep older when deduplication + + + True + + + NoControl + + + 479, 41 + + + 137, 13 + + + 30 + + + Statistics freshrate (second) + + + True + + + NoControl + + + 15, 39 + + + 364, 17 + + + 29 + + + Enable Statistics (Realtime netspeed and traffic records. Require restart) + + + True + + + 15, 16 + + + 193, 17 + + + 23 + + + Automatically start at system startup 117, 172 - 143, 20 + 143, 21 46 - - cmbCoreType6 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 0 - True @@ -2290,7 +1888,7 @@ 45, 176 - 59, 12 + 56, 13 47 @@ -2298,39 +1896,15 @@ Core Type - - labCoreType6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 1 - 117, 146 - 143, 20 + 143, 21 44 - - cmbCoreType5 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 2 - True @@ -2341,7 +1915,7 @@ 45, 150 - 59, 12 + 56, 13 45 @@ -2349,39 +1923,15 @@ Core Type - - labCoreType5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 3 - 117, 120 - 143, 20 + 143, 21 42 - - cmbCoreType4 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 4 - True @@ -2392,7 +1942,7 @@ 45, 124 - 59, 12 + 56, 13 43 @@ -2400,39 +1950,15 @@ Core Type - - labCoreType4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 5 - 117, 94 - 143, 20 + 143, 21 40 - - cmbCoreType3 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 6 - True @@ -2443,7 +1969,7 @@ 45, 98 - 59, 12 + 56, 13 41 @@ -2451,39 +1977,15 @@ Core Type - - labCoreType3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 7 - 117, 68 - 143, 20 + 143, 21 38 - - cmbCoreType2 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 8 - True @@ -2494,7 +1996,7 @@ 45, 72 - 59, 12 + 56, 13 39 @@ -2502,39 +2004,15 @@ Core Type - - labCoreType2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 9 - 117, 42 - 143, 20 + 143, 21 36 - - cmbCoreType1 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 10 - True @@ -2545,7 +2023,7 @@ 45, 46 - 59, 12 + 56, 13 37 @@ -2553,18 +2031,6 @@ Core Type - - labCoreType1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageCoreType - - - 11 - label18 @@ -2632,7 +2098,7 @@ 0, 0 - 728, 427 + 728, 471 42 @@ -2640,18 +2106,6 @@ Exception - - groupBox2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage3 - - - 0 - True @@ -2662,7 +2116,7 @@ 8, 346 - 329, 12 + 258, 13 45 @@ -2670,39 +2124,15 @@ Advanced proxy settings, protocol selection (optional) - - label18 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 0 - 8, 371 - 638, 20 + 638, 21 44 - - cmbSystemProxyAdvancedProtocol - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - True @@ -2713,7 +2143,7 @@ 6, 283 - 107, 12 + 88, 13 42 @@ -2721,18 +2151,6 @@ Use semicolon (;) - - label13 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 2 - True @@ -2743,7 +2161,7 @@ 8, 28 - 317, 12 + 256, 13 40 @@ -2751,18 +2169,6 @@ Do not use proxy server for addresses beginning with - - label12 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 3 - 8, 52 @@ -2778,18 +2184,6 @@ 41 - - txtsystemProxyExceptions - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 4 - btnOK @@ -2806,7 +2200,7 @@ Bottom - 0, 463 + 0, 507 736, 60 @@ -2838,18 +2232,6 @@ &OK - - btnOK - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - Top @@ -2874,14 +2256,14 @@ 2 - + True - + - 6, 12 + 6, 13 - 736, 523 + 736, 567 4, 4, 4, 4 @@ -2893,6 +2275,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..c8ed91ce 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx @@ -391,4 +391,7 @@ 检查Pre-Release更新(请谨慎启用) + + 为局域网和本地回环使用相通的端口 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 5e76f664..5188f785 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -138,22 +138,40 @@ namespace v2rayN.Handler if (config.inbound[0].allowLANConn) { - Inbounds inbound3 = GetInbound(config.inbound[0], Global.InboundSocks2, 2, true); - inbound3.listen = "0.0.0.0"; - v2rayConfig.inbounds.Add(inbound3); - - Inbounds inbound4 = GetInbound(config.inbound[0], Global.InboundHttp2, 3, false); - inbound4.listen = "0.0.0.0"; - v2rayConfig.inbounds.Add(inbound4); - - //auth - if (!Utils.IsNullOrEmpty(config.inbound[0].user) && !Utils.IsNullOrEmpty(config.inbound[0].pass)) + if (config.inbound[0].useSamePortForLocalAndLan) { - inbound3.settings.auth = "password"; - inbound3.settings.accounts = new List { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; + inbound.listen = "0.0.0.0"; + inbound2.listen = "0.0.0.0"; - inbound4.settings.auth = "password"; - inbound4.settings.accounts = new List { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; + //auth + if (!Utils.IsNullOrEmpty(config.inbound[0].user) && !Utils.IsNullOrEmpty(config.inbound[0].pass)) + { + inbound.settings.auth = "password"; + inbound.settings.accounts = new List { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; + + inbound2.settings.auth = "password"; + inbound2.settings.accounts = new List { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; + } + } + else + { + Inbounds inbound3 = GetInbound(config.inbound[0], Global.InboundSocks2, 2, true); + inbound3.listen = "0.0.0.0"; + v2rayConfig.inbounds.Add(inbound3); + + Inbounds inbound4 = GetInbound(config.inbound[0], Global.InboundHttp2, 3, false); + inbound4.listen = "0.0.0.0"; + v2rayConfig.inbounds.Add(inbound4); + + //auth + if (!Utils.IsNullOrEmpty(config.inbound[0].user) && !Utils.IsNullOrEmpty(config.inbound[0].pass)) + { + inbound3.settings.auth = "password"; + inbound3.settings.accounts = new List { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; + + inbound4.settings.auth = "password"; + inbound4.settings.accounts = new List { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } }; + } } } } diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index 6349b123..c575f598 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -615,6 +615,7 @@ namespace v2rayN.Mode public string pass { get; set; } + public bool useSamePortForLocalAndLan { get; set; } } [Serializable]