From fec47d4b728e29db9c3c19da5c4faff93da6aaf7 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 8 Jan 2022 20:27:36 +0800 Subject: [PATCH] add alpn/userAgent/ --- v2rayN/v2rayN/Forms/AddServer5Form.resx | 12 +- .../v2rayN/Forms/AddServer6Form.Designer.cs | 12 +- v2rayN/v2rayN/Forms/AddServer6Form.resx | 940 +++++++++--------- v2rayN/v2rayN/Forms/AddServerForm.resx | 12 +- .../Forms/ServerTransportControl.Designer.cs | 22 + v2rayN/v2rayN/Forms/ServerTransportControl.cs | 26 + .../v2rayN/Forms/ServerTransportControl.resx | 108 +- .../Forms/ServerTransportControl.zh-Hans.resx | 35 +- .../Forms/SubSettingControl.Designer.cs | 17 + v2rayN/v2rayN/Forms/SubSettingControl.cs | 2 + v2rayN/v2rayN/Forms/SubSettingControl.resx | 83 +- v2rayN/v2rayN/Global.cs | 1 - v2rayN/v2rayN/Handler/ConfigHandler.cs | 22 +- v2rayN/v2rayN/Handler/DownloadHandle.cs | 13 +- v2rayN/v2rayN/Handler/ShareHandler.cs | 11 +- v2rayN/v2rayN/Handler/SpeedtestHandler.cs | 6 +- v2rayN/v2rayN/Handler/UpdateHandle.cs | 3 +- v2rayN/v2rayN/Handler/V2rayConfigHandler.cs | 6 +- .../HttpProxyHandler/HttpProxyHandle.cs | 3 +- .../v2rayN/HttpProxyHandler/SysProxyHandle.cs | 9 - v2rayN/v2rayN/Mode/Config.cs | 72 +- v2rayN/v2rayN/Mode/V2rayConfig.cs | 7 + v2rayN/v2rayN/Mode/VmessQRCode.cs | 33 +- v2rayN/v2rayN/Properties/AssemblyInfo.cs | 2 +- v2rayN/v2rayN/Tool/Utils.cs | 45 +- v2rayN/v2rayN/v2rayN.csproj | 12 +- 26 files changed, 901 insertions(+), 613 deletions(-) diff --git a/v2rayN/v2rayN/Forms/AddServer5Form.resx b/v2rayN/v2rayN/Forms/AddServer5Form.resx index d8a0fd00..ab0fe1d5 100644 --- a/v2rayN/v2rayN/Forms/AddServer5Form.resx +++ b/v2rayN/v2rayN/Forms/AddServer5Form.resx @@ -541,7 +541,7 @@ 0, 10 - 729, 226 + 729, 221 3 @@ -589,7 +589,7 @@ Bottom - 0, 456 + 0, 461 729, 60 @@ -640,7 +640,7 @@ 0, 0 - 729, 220 + 729, 230 0 @@ -661,10 +661,10 @@ Bottom - 0, 236 + 0, 231 - 729, 220 + 729, 230 9 @@ -691,7 +691,7 @@ 6, 12 - 729, 516 + 729, 521 Edit or add a [VLESS] server diff --git a/v2rayN/v2rayN/Forms/AddServer6Form.Designer.cs b/v2rayN/v2rayN/Forms/AddServer6Form.Designer.cs index df133c13..6ad64150 100644 --- a/v2rayN/v2rayN/Forms/AddServer6Form.Designer.cs +++ b/v2rayN/v2rayN/Forms/AddServer6Form.Designer.cs @@ -54,15 +54,14 @@ // // 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); // // groupBox1 // - resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Controls.Add(this.cmbFlow); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.label13); @@ -74,12 +73,12 @@ this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.txtAddress); this.groupBox1.Controls.Add(this.label1); + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // // cmbFlow // - resources.ApplyResources(this.cmbFlow, "cmbFlow"); this.cmbFlow.FormattingEnabled = true; this.cmbFlow.Items.AddRange(new object[] { resources.GetString("cmbFlow.Items"), @@ -87,6 +86,7 @@ resources.GetString("cmbFlow.Items2"), resources.GetString("cmbFlow.Items3"), resources.GetString("cmbFlow.Items4")}); + resources.ApplyResources(this.cmbFlow, "cmbFlow"); this.cmbFlow.Name = "cmbFlow"; // // label4 @@ -141,21 +141,21 @@ // // panel3 // - resources.ApplyResources(this.panel3, "panel3"); this.panel3.Controls.Add(this.transportControl); + resources.ApplyResources(this.panel3, "panel3"); this.panel3.Name = "panel3"; // // transportControl // - resources.ApplyResources(this.transportControl, "transportControl"); this.transportControl.AllowXtls = false; + resources.ApplyResources(this.transportControl, "transportControl"); this.transportControl.Name = "transportControl"; // // panel2 // - resources.ApplyResources(this.panel2, "panel2"); this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnOK); + resources.ApplyResources(this.panel2, "panel2"); this.panel2.Name = "panel2"; // // btnOK diff --git a/v2rayN/v2rayN/Forms/AddServer6Form.resx b/v2rayN/v2rayN/Forms/AddServer6Form.resx index 62b47572..f95db419 100644 --- a/v2rayN/v2rayN/Forms/AddServer6Form.resx +++ b/v2rayN/v2rayN/Forms/AddServer6Form.resx @@ -117,137 +117,494 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + NoControl + - - 113, 12 + + 396, 17 - - 53, 12 - - - cmbFlow - - - label6 - - - xtls-rprx-origin + + 75, 23 - - True - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 27 - - + 4 - - - NoControl + + &Cancel - - panel3 + + btnClose - - Bottom + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - xtls-rprx-origin-udp443 - - - panel1 - - - 3 - - - Password - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0, 0 - - - groupBox1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 0 - - - Fill - - - groupBox1 - - - NoControl - - - 89, 12 - - - xtls-rprx-direct - - - 127, 27 - - - 2 - - - Edit or add a [Trojan] server - - - NoControl - - - 10 - - - 2 - - - xtls-rprx-direct-udp443 - - - 303, 17 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 + + panel2 0 + + + + + xtls-rprx-origin + + + xtls-rprx-origin-udp443 + + + xtls-rprx-direct + + + xtls-rprx-direct-udp443 + + + 127, 123 + + + 211, 20 + + + 3 + + + cmbFlow + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + True + + + NoControl + + + 12, 127 + + + 29, 12 + + + 27 + + + Flow + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + + + True + + + NoControl + + + 428, 158 + + + 113, 12 + + + 22 + + + * Fill in manually + + + label13 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + + + 127, 155 + + + 265, 21 + + + 4 + + + txtRemarks + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 3 + + + True + + + NoControl + + + 12, 159 + + + 95, 12 + + + 10 + + + Alias (remarks) + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 4 + + + 127, 91 + + + 265, 21 + + + 2 + + + txtId + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 5 + + + True + + + NoControl + + + 12, 93 + + + 53, 12 + + + 4 + + + Password + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 6 + + + 127, 59 + + + 194, 21 + + + 1 + + + txtPort + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 7 + + + True + + + NoControl + + + 12, 62 + + + 71, 12 + + + 2 + + + Server port + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 8 + + + 127, 27 + 359, 21 - - $this + + 0 + + + txtAddress System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 396, 17 + + groupBox1 + + + 9 + + + True + + + NoControl + + + 12, 31 + + + 89, 12 + + + 0 + + + Server address + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 10 + + + Fill + + + 0, 10 + + + 707, 191 + + + 3 + + + Server + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Fill + + + 0, 0 + + + 707, 230 + + + 0 + + + transportControl + + + v2rayN.Forms.ServerTransportControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + panel3 + + + 0 + + + Bottom + + + 0, 201 + + + 707, 230 + + + 8 + + + panel3 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + NoControl + + + 303, 17 + + + 75, 23 + + + 5 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + Bottom + + + 0, 431 + + + 707, 60 + + + 7 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + Top + + + 0, 0 + + + 707, 10 + + + 6 + + + panel1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + True + + + 6, 12 + + + 707, 491 @@ -422,370 +779,13 @@ wf+0BQAAgAUAAIAFAACAAQAAgAHB/4ABAACAAQAAgAEAALwBAAC8AQAAvAHB/4ABbP///5H/ - - 8 - - - label1 - - - 707, 60 - - - 0, 0 - - - v2rayN.Forms.ServerTransportControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - True - - - 22 - - - panel3 - - - True - - - 127, 91 - - - panel2 - - - 0 - - - 5 - - - 3 - - - Alias (remarks) - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 707, 220 - - - groupBox1 - - - groupBox1 - - - txtId - - - 12, 127 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 12, 31 - - - groupBox1 - - - 1 + + Edit or add a [Trojan] server AddServer6Form - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 3 - - - 127, 59 - - - 1 - - - 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 71, 12 - - - NoControl - - - Bottom - - - $this - - - groupBox1 - - - 127, 123 - - - txtPort - - - 707, 10 - - - 0, 10 - - - 5 - - - label4 - - - &OK - - - btnClose - - - panel2 - - - 0 - - - 0 - - - 12, 93 - - - 2 - - - groupBox1 - - - 10 - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 194, 21 - - - 0 - - - 1 - - - 6 - - - 2 - - - 7 - - - label13 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 8 - v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - label3 - - - Server port - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0, 425 - - - 9 - - - &Cancel - - - 707, 220 - - - True - - - 6, 12 - - - Server address - - - 0, 205 - - - txtAddress - - - 127, 155 - - - NoControl - - - 95, 12 - - - 428, 158 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - * Fill in manually - - - 7 - - - label2 - - - 12, 62 - - - NoControl - - - 707, 485 - - - 265, 21 - - - btnOK - - - $this - - - 707, 195 - - - 4 - - - 75, 23 - - - 6 - - - transportControl - - - NoControl - - - 4 - - - 3 - - - 211, 20 - - - 75, 23 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 29, 12 - - - groupBox1 - - - groupBox1 - - - Server - - - txtRemarks - - - 12, 159 - - - True - - - Flow - - - 265, 21 - - - Top - - - 1 - - - True - \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServerForm.resx b/v2rayN/v2rayN/Forms/AddServerForm.resx index 82469f68..665f5325 100644 --- a/v2rayN/v2rayN/Forms/AddServerForm.resx +++ b/v2rayN/v2rayN/Forms/AddServerForm.resx @@ -532,7 +532,7 @@ 0, 35 - 729, 219 + 729, 216 3 @@ -580,7 +580,7 @@ Bottom - 0, 474 + 0, 481 729, 60 @@ -682,7 +682,7 @@ 0, 0 - 729, 220 + 729, 230 0 @@ -703,10 +703,10 @@ Bottom - 0, 254 + 0, 251 - 729, 220 + 729, 230 9 @@ -733,7 +733,7 @@ 6, 12 - 729, 534 + 729, 541 Edit or add a [VMess] server diff --git a/v2rayN/v2rayN/Forms/ServerTransportControl.Designer.cs b/v2rayN/v2rayN/Forms/ServerTransportControl.Designer.cs index db395e1e..04f0f374 100644 --- a/v2rayN/v2rayN/Forms/ServerTransportControl.Designer.cs +++ b/v2rayN/v2rayN/Forms/ServerTransportControl.Designer.cs @@ -31,6 +31,7 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServerTransportControl)); this.gbTransport = new System.Windows.Forms.GroupBox(); this.panTlsMore = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); this.txtSNI = new System.Windows.Forms.TextBox(); this.labSNI = new System.Windows.Forms.Label(); this.labAllowInsecure = new System.Windows.Forms.Label(); @@ -49,6 +50,7 @@ this.labHeaderType = new System.Windows.Forms.Label(); this.labRequestHost = new System.Windows.Forms.Label(); this.cmbHeaderType = new System.Windows.Forms.ComboBox(); + this.clbAlpn = new System.Windows.Forms.CheckedListBox(); this.gbTransport.SuspendLayout(); this.panTlsMore.SuspendLayout(); this.SuspendLayout(); @@ -76,6 +78,8 @@ // // panTlsMore // + this.panTlsMore.Controls.Add(this.clbAlpn); + this.panTlsMore.Controls.Add(this.label1); this.panTlsMore.Controls.Add(this.txtSNI); this.panTlsMore.Controls.Add(this.labSNI); this.panTlsMore.Controls.Add(this.labAllowInsecure); @@ -83,6 +87,11 @@ resources.ApplyResources(this.panTlsMore, "panTlsMore"); this.panTlsMore.Name = "panTlsMore"; // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // // txtSNI // resources.ApplyResources(this.txtSNI, "txtSNI"); @@ -202,6 +211,17 @@ resources.ApplyResources(this.cmbHeaderType, "cmbHeaderType"); this.cmbHeaderType.Name = "cmbHeaderType"; // + // clbAlpn + // + this.clbAlpn.CheckOnClick = true; + resources.ApplyResources(this.clbAlpn, "clbAlpn"); + this.clbAlpn.FormattingEnabled = true; + this.clbAlpn.Items.AddRange(new object[] { + resources.GetString("clbAlpn.Items"), + resources.GetString("clbAlpn.Items1")}); + this.clbAlpn.MultiColumn = true; + this.clbAlpn.Name = "clbAlpn"; + // // ServerTransportControl // resources.ApplyResources(this, "$this"); @@ -239,5 +259,7 @@ private System.Windows.Forms.Label labHeaderType; private System.Windows.Forms.Label labRequestHost; private System.Windows.Forms.ComboBox cmbHeaderType; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckedListBox clbAlpn; } } diff --git a/v2rayN/v2rayN/Forms/ServerTransportControl.cs b/v2rayN/v2rayN/Forms/ServerTransportControl.cs index 40c6a9c5..583d65cc 100644 --- a/v2rayN/v2rayN/Forms/ServerTransportControl.cs +++ b/v2rayN/v2rayN/Forms/ServerTransportControl.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Windows.Forms; using v2rayN.Mode; @@ -41,6 +42,17 @@ namespace v2rayN.Forms cmbStreamSecurity.Text = vmessItem.streamSecurity; cmbAllowInsecure.Text = vmessItem.allowInsecure; txtSNI.Text = vmessItem.sni; + + if (vmessItem.alpn != null) + { + for (int i = 0; i < clbAlpn.Items.Count; i++) + { + if (vmessItem.alpn.Contains(clbAlpn.Items[i].ToString())) + { + clbAlpn.SetItemChecked(i, true); + } + } + } } public void ClearServer(VmessItem item) @@ -54,6 +66,10 @@ namespace v2rayN.Forms cmbAllowInsecure.Text = ""; txtPath.Text = ""; txtSNI.Text = ""; + for (int i = 0; i < clbAlpn.Items.Count; i++) + { + clbAlpn.SetItemChecked(i, false); + } } public void EndBindingServer() @@ -73,6 +89,16 @@ namespace v2rayN.Forms vmessItem.streamSecurity = streamSecurity; vmessItem.allowInsecure = allowInsecure; vmessItem.sni = sni; + + var alpn = new List(); + for (int i = 0; i < clbAlpn.Items.Count; i++) + { + if (clbAlpn.GetItemChecked(i)) + { + alpn.Add(clbAlpn.Items[i].ToString()); + } + } + vmessItem.alpn = alpn; } private void cmbNetwork_SelectedIndexChanged(object sender, EventArgs e) diff --git a/v2rayN/v2rayN/Forms/ServerTransportControl.resx b/v2rayN/v2rayN/Forms/ServerTransportControl.resx index 32e2e234..f7f94e4a 100644 --- a/v2rayN/v2rayN/Forms/ServerTransportControl.resx +++ b/v2rayN/v2rayN/Forms/ServerTransportControl.resx @@ -117,14 +117,75 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 70 + + + h2 + + + http/1.1 + + + 313, 7 + + + 172, 20 + + + 44 + + + clbAlpn + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panTlsMore + + + 0 + + + True + + + + NoControl + + + 241, 11 + + + 29, 12 + + + 43 + + + alpn + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panTlsMore + + + 1 + - 300, 7 + 100, 39 - 197, 21 + 385, 21 - 1 @@ -138,17 +199,16 @@ panTlsMore - 0 + 2 True - NoControl - 270, 11 + 12, 43 23, 12 @@ -169,7 +229,7 @@ panTlsMore - 1 + 3 True @@ -199,7 +259,7 @@ panTlsMore - 2 + 4 @@ -229,13 +289,13 @@ panTlsMore - 3 + 5 - 200, 171 + 200, 149 - 500, 35 + 500, 71 33 @@ -283,7 +343,7 @@ 1 - 127, 136 + 127, 124 True @@ -382,7 +442,7 @@ NoControl - 9, 140 + 9, 128 29, 12 @@ -412,7 +472,7 @@ NoControl - 529, 140 + 529, 128 11, 12 @@ -442,7 +502,7 @@ NoControl - 464, 104 + 464, 96 11, 12 @@ -472,7 +532,7 @@ NoControl - 9, 182 + 9, 160 23, 12 @@ -496,7 +556,7 @@ 8 - 127, 178 + 127, 156 60, 20 @@ -523,7 +583,7 @@ NoControl - 282, 66 + 282, 64 11, 12 @@ -547,7 +607,7 @@ 10 - 158, 100 + 158, 92 True @@ -577,7 +637,7 @@ NoControl - 9, 66 + 9, 64 95, 12 @@ -607,7 +667,7 @@ NoControl - 9, 104 + 9, 96 143, 12 @@ -652,7 +712,7 @@ wireguard - 127, 64 + 127, 60 143, 20 @@ -679,7 +739,7 @@ 0, 0 - 723, 220 + 723, 223 22 @@ -706,7 +766,7 @@ 6, 12 - 723, 220 + 723, 223 ServerTransportControl diff --git a/v2rayN/v2rayN/Forms/ServerTransportControl.zh-Hans.resx b/v2rayN/v2rayN/Forms/ServerTransportControl.zh-Hans.resx index a70f28e7..34a92e99 100644 --- a/v2rayN/v2rayN/Forms/ServerTransportControl.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/ServerTransportControl.zh-Hans.resx @@ -118,15 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 167, 12 - - - 跳过证书验证(allowInsecure) - - - 183, 7 - 143, 12 @@ -157,11 +148,8 @@ 底层传输安全(tls) - - 203, 12 - - 127, 100 + 127, 92 331, 20 @@ -181,4 +169,25 @@ 底层传输方式(transport) + + 282, 11 + + + 331, 7 + + + 160, 20 + + + 391, 21 + + + 167, 12 + + + 跳过证书验证(allowInsecure) + + + 183, 7 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs b/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs index 8ffe9ca4..09080977 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs +++ b/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs @@ -30,6 +30,8 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingControl)); this.grbMain = new System.Windows.Forms.GroupBox(); + this.txtUserAgent = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); this.btnShare = new System.Windows.Forms.Button(); this.chkEnabled = new System.Windows.Forms.CheckBox(); this.btnRemove = new System.Windows.Forms.Button(); @@ -44,6 +46,8 @@ // // grbMain // + this.grbMain.Controls.Add(this.txtUserAgent); + this.grbMain.Controls.Add(this.label1); this.grbMain.Controls.Add(this.btnShare); this.grbMain.Controls.Add(this.chkEnabled); this.grbMain.Controls.Add(this.btnRemove); @@ -55,6 +59,17 @@ this.grbMain.Name = "grbMain"; this.grbMain.TabStop = false; // + // txtUserAgent + // + resources.ApplyResources(this.txtUserAgent, "txtUserAgent"); + this.txtUserAgent.Name = "txtUserAgent"; + this.txtUserAgent.Leave += new System.EventHandler(this.txtRemarks_Leave); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // // btnShare // resources.ApplyResources(this.btnShare, "btnShare"); @@ -130,5 +145,7 @@ private System.Windows.Forms.CheckBox chkEnabled; private System.Windows.Forms.Button btnShare; private System.Windows.Forms.PictureBox picQRCode; + private System.Windows.Forms.TextBox txtUserAgent; + private System.Windows.Forms.Label label1; } } diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.cs b/v2rayN/v2rayN/Forms/SubSettingControl.cs index 652e389e..3d816c10 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.cs +++ b/v2rayN/v2rayN/Forms/SubSettingControl.cs @@ -35,6 +35,7 @@ namespace v2rayN.Forms txtRemarks.Text = subItem.remarks.ToString(); txtUrl.Text = subItem.url.ToString(); chkEnabled.Checked = subItem.enabled; + txtUserAgent.Text = subItem.userAgent; } } private void EndBindingSub() @@ -44,6 +45,7 @@ namespace v2rayN.Forms subItem.remarks = txtRemarks.Text.TrimEx(); subItem.url = txtUrl.Text.TrimEx(); subItem.enabled = chkEnabled.Checked; + subItem.userAgent = txtUserAgent.Text.TrimEx(); } } private void txtRemarks_Leave(object sender, EventArgs e) diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.resx b/v2rayN/v2rayN/Forms/SubSettingControl.resx index f06a5702..a9449a19 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.resx +++ b/v2rayN/v2rayN/Forms/SubSettingControl.resx @@ -117,18 +117,69 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 127, 111 + + + 473, 21 + + + + 3 + + + txtUserAgent + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grbMain + + + 0 + + + True + + + NoControl + + + 12, 115 + + + 65, 12 + + + 27 + + + User Agent + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grbMain + + + 1 + NoControl - 434, 21 75, 23 - 26 @@ -145,7 +196,7 @@ grbMain - 0 + 2 True @@ -175,7 +226,7 @@ grbMain - 1 + 3 NoControl @@ -202,10 +253,10 @@ grbMain - 2 + 4 - 127, 55 + 127, 53 True @@ -217,7 +268,7 @@ 473, 46 - 23 + 2 txtUrl @@ -229,7 +280,7 @@ grbMain - 3 + 5 127, 21 @@ -238,7 +289,7 @@ 232, 21 - 11 + 1 txtRemarks @@ -250,7 +301,7 @@ grbMain - 4 + 6 True @@ -280,7 +331,7 @@ grbMain - 5 + 7 True @@ -289,7 +340,7 @@ NoControl - 12, 55 + 12, 53 83, 12 @@ -310,7 +361,7 @@ grbMain - 6 + 8 Top @@ -319,7 +370,7 @@ 0, 0 - 619, 110 + 619, 148 10 @@ -346,10 +397,10 @@ NoControl - 0, 110 + 0, 148 - 619, 200 + 619, 162 Zoom diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 0a37c2c6..466119c2 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -21,7 +21,6 @@ namespace v2rayN /// public const string SpeedTestUrl = @"http://cachefly.cachefly.net/10mb.test"; public const string SpeedPingTestUrl = @"https://www.google.com/generate_204"; - public const string AvailabilityTestUrl = @"https://www.google.com/generate_204"; /// /// CustomRoutingListUrl diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index 1c35c368..b1c16c6b 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -128,18 +128,22 @@ namespace v2rayN.Handler config.uiItem.mainLvColWidth = new Dictionary(); } - //// 如果是用户升级,首次会有端口号为0的情况,不可用,这里处理 - //if (config.pacPort == 0) - //{ - // config.pacPort = 8888; - //} - if (Utils.IsNullOrEmpty(config.speedTestUrl)) + + if (config.constItem == null) { - config.speedTestUrl = Global.SpeedTestUrl; + config.constItem = new ConstItem(); } - if (Utils.IsNullOrEmpty(config.speedPingTestUrl)) + if (Utils.IsNullOrEmpty(config.constItem.speedTestUrl)) { - config.speedPingTestUrl = Global.SpeedPingTestUrl; + config.constItem.speedTestUrl = Global.SpeedTestUrl; + } + if (Utils.IsNullOrEmpty(config.constItem.speedPingTestUrl)) + { + config.constItem.speedPingTestUrl = Global.SpeedPingTestUrl; + } + if (Utils.IsNullOrEmpty(config.constItem.defIEProxyExceptions)) + { + config.constItem.defIEProxyExceptions = Global.IEProxyExceptions; } //if (Utils.IsNullOrEmpty(config.remoteDNS)) //{ diff --git a/v2rayN/v2rayN/Handler/DownloadHandle.cs b/v2rayN/v2rayN/Handler/DownloadHandle.cs index 04d777b4..a3834fa6 100644 --- a/v2rayN/v2rayN/Handler/DownloadHandle.cs +++ b/v2rayN/v2rayN/Handler/DownloadHandle.cs @@ -13,7 +13,7 @@ namespace v2rayN.Handler public event EventHandler UpdateCompleted; public event ErrorEventHandler Error; - + public class ResultEventArgs : EventArgs { @@ -31,7 +31,7 @@ namespace v2rayN.Handler private long totalBytesToReceive = 0; private DateTime totalDatetime = new DateTime(); private int DownloadTimeout = -1; - + public WebClientEx DownloadFileAsync(string url, WebProxy webProxy, int downloadTimeout) { WebClientEx ws = new WebClientEx(); @@ -62,7 +62,7 @@ namespace v2rayN.Handler } return ws; } - + void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { if (UpdateCompleted != null) @@ -131,7 +131,7 @@ namespace v2rayN.Handler /// DownloadString /// /// - public void WebDownloadString(string url) + public void WebDownloadString(string url, string userAgent) { string source = string.Empty; try @@ -139,6 +139,11 @@ namespace v2rayN.Handler Utils.SetSecurityProtocol(); WebClientEx ws = new WebClientEx(); + if (!Utils.IsNullOrEmpty(userAgent)) + { + ws.Headers.Add("user-agent", userAgent); + } + ws.DownloadStringCompleted += Ws_DownloadStringCompleted; ws.DownloadStringAsync(new Uri(url)); } diff --git a/v2rayN/v2rayN/Handler/ShareHandler.cs b/v2rayN/v2rayN/Handler/ShareHandler.cs index b22fe83b..4571ccf3 100644 --- a/v2rayN/v2rayN/Handler/ShareHandler.cs +++ b/v2rayN/v2rayN/Handler/ShareHandler.cs @@ -76,7 +76,8 @@ namespace v2rayN.Handler host = item.requestHost, path = item.path, tls = item.streamSecurity, - sni = item.sni + sni = item.sni, + alpn = Utils.List2String(item.alpn) }; url = Utils.ToJson(vmessQRCode); @@ -180,6 +181,10 @@ namespace v2rayN.Handler { dicQuery.Add("sni", item.sni); } + if (item.alpn != null && item.alpn.Count > 0) + { + dicQuery.Add("alpn", Utils.UrlEncode(Utils.List2String(item.alpn))); + } if (!Utils.IsNullOrEmpty(item.network)) { dicQuery.Add("type", item.network); @@ -422,8 +427,9 @@ namespace v2rayN.Handler vmessItem.path = Utils.ToString(vmessQRCode.path); vmessItem.streamSecurity = Utils.ToString(vmessQRCode.tls); vmessItem.sni = Utils.ToString(vmessQRCode.sni); + vmessItem.alpn = Utils.String2List(vmessQRCode.alpn); - return vmessItem; + return vmessItem; } private static VmessItem ResolveVmess4Kitsunebi(string result) @@ -730,6 +736,7 @@ namespace v2rayN.Handler item.security = query["encryption"] ?? "none"; item.streamSecurity = query["security"] ?? ""; item.sni = query["sni"] ?? ""; + item.alpn = Utils.String2List(Utils.UrlDecode(query["alpn"] ?? "")); item.network = query["type"] ?? "tcp"; switch (item.network) { diff --git a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs index 084e09c0..d8eb1eee 100644 --- a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs +++ b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs @@ -122,7 +122,7 @@ namespace v2rayN.Handler { WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + itemIndex); int responseTime = -1; - string status = GetRealPingTime(_config.speedPingTestUrl, webProxy, out responseTime); + string status = GetRealPingTime(_config.constItem.speedPingTestUrl, webProxy, out responseTime); string output = Utils.IsNullOrEmpty(status) ? FormatOut(responseTime, "ms") : FormatOut(status, ""); _updateFunc(itemIndex, output); } @@ -157,7 +157,7 @@ namespace v2rayN.Handler { WebProxy webProxy = new WebProxy(Global.Loopback, httpPort); int responseTime = -1; - string status = GetRealPingTime(Global.AvailabilityTestUrl, webProxy, out responseTime); + string status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out responseTime); bool noError = Utils.IsNullOrEmpty(status); return noError ? responseTime : -1; } @@ -193,7 +193,7 @@ namespace v2rayN.Handler return; } - string url = _config.speedTestUrl; + string url = _config.constItem.speedTestUrl; DownloadHandle downloadHandle2 = new DownloadHandle(); downloadHandle2.UpdateCompleted += (sender2, args) => { diff --git a/v2rayN/v2rayN/Handler/UpdateHandle.cs b/v2rayN/v2rayN/Handler/UpdateHandle.cs index ee7e09a0..09ebcbac 100644 --- a/v2rayN/v2rayN/Handler/UpdateHandle.cs +++ b/v2rayN/v2rayN/Handler/UpdateHandle.cs @@ -179,6 +179,7 @@ namespace v2rayN.Handler { string id = config.subItem[k - 1].id.Trim(); string url = config.subItem[k - 1].url.Trim(); + string userAgent = config.subItem[k - 1].userAgent.Trim(); string hashCode = $"{k}->"; if (config.subItem[k - 1].enabled == false) { @@ -227,7 +228,7 @@ namespace v2rayN.Handler _updateFunc(false, args.GetException().Message); }; - downloadHandle3.WebDownloadString(url); + downloadHandle3.WebDownloadString(url, userAgent); _updateFunc(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}"); } diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 972c8309..b95595cd 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -587,7 +587,8 @@ namespace v2rayN.Handler TlsSettings tlsSettings = new TlsSettings { - allowInsecure = config.allowInsecure() + allowInsecure = config.allowInsecure(), + alpn = config.alpn() }; if (!string.IsNullOrWhiteSpace(sni)) { @@ -607,7 +608,8 @@ namespace v2rayN.Handler TlsSettings xtlsSettings = new TlsSettings { - allowInsecure = config.allowInsecure() + allowInsecure = config.allowInsecure(), + alpn = config.alpn() }; if (!string.IsNullOrWhiteSpace(sni)) { diff --git a/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs index 5372fd79..d4f14af0 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs @@ -166,7 +166,8 @@ namespace v2rayN.HttpProxyHandler } if (type == ESysProxyType.ForcedChange) { - SysProxyHandle.SetIEProxy(true, $"{Global.Loopback}:{port}", config.systemProxyExceptions); + var strExceptions = $"{config.constItem.defIEProxyExceptions};{config.systemProxyExceptions}"; + SysProxyHandle.SetIEProxy(true, $"{Global.Loopback}:{port}", strExceptions); } else if (type == ESysProxyType.ForcedClear) { diff --git a/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs index 6fedd91b..2d6f96e0 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs @@ -85,15 +85,6 @@ namespace v2rayN.HttpProxyHandler public static void SetIEProxy(bool global, string strProxy, string strExceptions) { - if (Utils.IsNullOrEmpty(strExceptions)) - { - strExceptions = Global.IEProxyExceptions; - } - else - { - strExceptions = $"{Global.IEProxyExceptions};{strExceptions}"; - } - string arguments = global ? $"global {strProxy} {strExceptions}" : $"pac {strProxy}"; diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index a8a54cb2..b3dfa5c8 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -76,21 +76,6 @@ namespace v2rayN.Mode get; set; } - /// - /// 自定义服务器下载测速url - /// - public string speedTestUrl - { - get; set; - } - /// - /// 自定义“服务器真连接延迟”测试url - /// - public string speedPingTestUrl - { - get; set; - } - /// /// 允许来自局域网的连接 /// @@ -200,6 +185,10 @@ namespace v2rayN.Mode get; set; } = 0; + public ConstItem constItem + { + get; set; + } #region 函数 public string address() @@ -371,6 +360,21 @@ namespace v2rayN.Mode } return vmess[index].sni.TrimEx(); } + public List alpn() + { + if (index < 0) + { + return null; + } + if (vmess[index].alpn != null && vmess[index].alpn.Count > 0) + { + return vmess[index].alpn; + } + else + { + return null; + } + } #endregion } @@ -604,6 +608,13 @@ namespace v2rayN.Mode { get; set; } + /// + /// tls alpn + /// + public List alpn + { + get; set; + } } [Serializable] @@ -725,6 +736,14 @@ namespace v2rayN.Mode /// enable /// public bool enabled { get; set; } = true; + + /// + /// + /// + public string userAgent + { + get; set; + } = string.Empty; } [Serializable] @@ -742,4 +761,27 @@ namespace v2rayN.Mode get; set; } } + + [Serializable] + public class ConstItem + { + /// + /// 自定义服务器下载测速url + /// + public string speedTestUrl + { + get; set; + } + /// + /// 自定义“服务器真连接延迟”测试url + /// + public string speedPingTestUrl + { + get; set; + } + public string defIEProxyExceptions + { + get; set; + } + } } diff --git a/v2rayN/v2rayN/Mode/V2rayConfig.cs b/v2rayN/v2rayN/Mode/V2rayConfig.cs index b2680243..4703ec21 100644 --- a/v2rayN/v2rayN/Mode/V2rayConfig.cs +++ b/v2rayN/v2rayN/Mode/V2rayConfig.cs @@ -404,6 +404,13 @@ namespace v2rayN.Mode /// /// public string serverName { get; set; } + /// + /// + /// + public List alpn + { + get; set; + } } public class TcpSettings diff --git a/v2rayN/v2rayN/Mode/VmessQRCode.cs b/v2rayN/v2rayN/Mode/VmessQRCode.cs index 34317b74..c4db42b4 100644 --- a/v2rayN/v2rayN/Mode/VmessQRCode.cs +++ b/v2rayN/v2rayN/Mode/VmessQRCode.cs @@ -2,61 +2,68 @@ namespace v2rayN.Mode { + /// + /// https://github.com/2dust/v2rayN/wiki/ + /// [Serializable] class VmessQRCode { /// - /// 版本 + /// /// public string v { get; set; } = string.Empty; /// - /// 备注 + /// /// public string ps { get; set; } = string.Empty; /// - /// VMess 远程服务器地址 + /// /// public string add { get; set; } = string.Empty; /// - /// VMess 远程服务器端口 + /// /// public string port { get; set; } = string.Empty; /// - /// VMess 远程服务器ID + /// /// public string id { get; set; } = string.Empty; /// - /// VMess 远程服务器额外ID + /// /// public string aid { get; set; } = string.Empty; /// - /// VMess Security + /// /// public string scy { get; set; } = string.Empty; /// - /// 传输协议tcp,kcp,ws + /// /// public string net { get; set; } = string.Empty; /// - /// 伪装类型 + /// /// public string type { get; set; } = string.Empty; /// - /// 伪装的域名 + /// /// public string host { get; set; } = string.Empty; /// - /// path + /// /// public string path { get; set; } = string.Empty; /// - /// 底层传输安全 + /// TLS /// public string tls { get; set; } = string.Empty; /// - /// SNI + /// TLS SNI /// public string sni { get; set; } = string.Empty; + /// + /// TLS alpn + /// + public string alpn { get; set; } = string.Empty; } } diff --git a/v2rayN/v2rayN/Properties/AssemblyInfo.cs b/v2rayN/v2rayN/Properties/AssemblyInfo.cs index d9910968..20c67a96 100644 --- a/v2rayN/v2rayN/Properties/AssemblyInfo.cs +++ b/v2rayN/v2rayN/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ using System.Runtime.InteropServices; // 方法是按如下所示使用“*”: //[assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("4.27")] +[assembly: AssemblyFileVersion("4.28")] diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index 6196ce69..b0db10ed 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -180,6 +180,10 @@ namespace v2rayN { try { + if (lst == null) + { + return string.Empty; + } if (wrap) { return string.Join("," + Environment.NewLine, lst.ToArray()); @@ -627,6 +631,26 @@ namespace v2rayN regKey?.Close(); } } + + /// + /// 判断.Net Framework的Release是否符合 + /// (.Net Framework 版本在4.0及以上) + /// + /// 需要的版本4.6.2=394802;4.8=528040 + /// + public static bool GetDotNetRelease(int release) + { + const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"; + using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey)) + { + if (ndpKey != null && ndpKey.GetValue("Release") != null) + { + return (int)ndpKey.GetValue("Release") >= release ? true : false; + } + return false; + } + } + #endregion #region 测速 @@ -693,11 +717,22 @@ namespace v2rayN public static void SetSecurityProtocol() { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 - | SecurityProtocolType.Tls - | SecurityProtocolType.Tls11 - | SecurityProtocolType.Tls12 - | SecurityProtocolType.Tls13; + //.NET Framework 4.8 + if (GetDotNetRelease(528040)) + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 + | SecurityProtocolType.Tls + | SecurityProtocolType.Tls11 + | SecurityProtocolType.Tls12 + | SecurityProtocolType.Tls13; + } + else + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 + | SecurityProtocolType.Tls + | SecurityProtocolType.Tls11 + | SecurityProtocolType.Tls12; + } ServicePointManager.DefaultConnectionLimit = 256; } #endregion diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index b2601936..203b51d2 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -487,24 +487,24 @@ - 3.11.4 + 3.19.1 - 2.27.0 + 2.42.0 - 2.27.0 + 2.42.0 runtime; build; native; contentfiles; analyzers; buildtransitive all - 2.0.13 + 2.0.14 - 12.0.3 + 13.0.1 - 0.16.5 + 0.16.7