Enable subscription conversion
This commit is contained in:
9
clashN/clashN/Forms/AddProfileForm.Designer.cs
generated
9
clashN/clashN/Forms/AddProfileForm.Designer.cs
generated
@@ -31,6 +31,7 @@
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddProfileForm));
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.chkEnableConvert = new System.Windows.Forms.CheckBox();
|
||||
this.chkEnableTun = new System.Windows.Forms.CheckBox();
|
||||
this.chkEnabled = new System.Windows.Forms.CheckBox();
|
||||
this.txtUserAgent = new System.Windows.Forms.TextBox();
|
||||
@@ -63,6 +64,7 @@
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.chkEnableConvert);
|
||||
this.groupBox1.Controls.Add(this.chkEnableTun);
|
||||
this.groupBox1.Controls.Add(this.chkEnabled);
|
||||
this.groupBox1.Controls.Add(this.txtUserAgent);
|
||||
@@ -82,6 +84,12 @@
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// chkEnableConvert
|
||||
//
|
||||
resources.ApplyResources(this.chkEnableConvert, "chkEnableConvert");
|
||||
this.chkEnableConvert.Name = "chkEnableConvert";
|
||||
this.chkEnableConvert.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkEnableTun
|
||||
//
|
||||
resources.ApplyResources(this.chkEnableTun, "chkEnableTun");
|
||||
@@ -226,5 +234,6 @@
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.CheckBox chkEnabled;
|
||||
private System.Windows.Forms.CheckBox chkEnableTun;
|
||||
private System.Windows.Forms.CheckBox chkEnableConvert;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,6 @@ namespace clashN.Forms
|
||||
profileItem = new ProfileItem();
|
||||
profileItem.groupId = groupId;
|
||||
profileItem.enabled = true;
|
||||
ClearProfile();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +48,7 @@ namespace clashN.Forms
|
||||
chkEnabled.Checked = profileItem.enabled;
|
||||
txtUserAgent.Text = profileItem.userAgent;
|
||||
chkEnableTun.Checked = profileItem.enableTun;
|
||||
chkEnableConvert.Checked = profileItem.enableConvert;
|
||||
|
||||
if (profileItem.coreType == null)
|
||||
{
|
||||
@@ -60,16 +60,6 @@ namespace clashN.Forms
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清除设置
|
||||
/// </summary>
|
||||
private void ClearProfile()
|
||||
{
|
||||
txtRemarks.Text = "";
|
||||
chkEnabled.Enabled = true;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
string remarks = txtRemarks.Text;
|
||||
@@ -88,6 +78,7 @@ namespace clashN.Forms
|
||||
profileItem.enabled = chkEnabled.Checked;
|
||||
profileItem.userAgent = txtUserAgent.Text.TrimEx();
|
||||
profileItem.enableTun = chkEnableTun.Checked;
|
||||
profileItem.enableConvert = chkEnableConvert.Checked;
|
||||
|
||||
if (profileItem.enableTun)
|
||||
{
|
||||
|
||||
@@ -83,17 +83,50 @@
|
||||
<data name=">>btnClose.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="chkEnableTun.AutoSize" type="System.Boolean, mscorlib">
|
||||
<data name="chkEnableConvert.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="chkEnableConvert.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="chkEnableConvert.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>143, 338</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="chkEnableConvert.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 4, 4, 4</value>
|
||||
</data>
|
||||
<data name="chkEnableConvert.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>208, 21</value>
|
||||
</data>
|
||||
<data name="chkEnableConvert.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>50</value>
|
||||
</data>
|
||||
<data name="chkEnableConvert.Text" xml:space="preserve">
|
||||
<value>Enable subscription conversion</value>
|
||||
</data>
|
||||
<data name=">>chkEnableConvert.Name" xml:space="preserve">
|
||||
<value>chkEnableConvert</value>
|
||||
</data>
|
||||
<data name=">>chkEnableConvert.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>chkEnableConvert.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>chkEnableConvert.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="chkEnableTun.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="chkEnableTun.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="chkEnableTun.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>261, 266</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="chkEnableTun.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 4, 4, 4</value>
|
||||
</data>
|
||||
@@ -116,7 +149,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>chkEnableTun.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="chkEnabled.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -149,7 +182,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>chkEnabled.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="txtUserAgent.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>143, 222</value>
|
||||
@@ -173,7 +206,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtUserAgent.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -206,7 +239,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label2.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>143, 62</value>
|
||||
@@ -236,7 +269,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtUrl.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -269,7 +302,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label3.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="btnEdit.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
@@ -296,7 +329,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>btnEdit.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="cmbCoreType.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>143, 264</value>
|
||||
@@ -317,7 +350,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="labCoreType.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -347,7 +380,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>labCoreType.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="btnBrowse.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
@@ -374,7 +407,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>btnBrowse.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>143, 123</value>
|
||||
@@ -398,7 +431,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtAddress.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -425,7 +458,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label13.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>143, 23</value>
|
||||
@@ -446,7 +479,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtRemarks.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
<value>13</value>
|
||||
</data>
|
||||
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -473,7 +506,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label6.ZOrder" xml:space="preserve">
|
||||
<value>13</value>
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -500,7 +533,7 @@
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>14</value>
|
||||
<value>15</value>
|
||||
</data>
|
||||
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
@@ -509,7 +542,7 @@
|
||||
<value>0, 10</value>
|
||||
</data>
|
||||
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>642, 364</value>
|
||||
<value>642, 375</value>
|
||||
</data>
|
||||
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
@@ -529,42 +562,6 @@
|
||||
<data name=">>groupBox1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>btnOK.Name" xml:space="preserve">
|
||||
<value>btnOK</value>
|
||||
</data>
|
||||
<data name=">>btnOK.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>btnOK.Parent" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>btnOK.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Bottom</value>
|
||||
</data>
|
||||
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 374</value>
|
||||
</data>
|
||||
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>642, 60</value>
|
||||
</data>
|
||||
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name=">>panel2.Name" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>panel2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>357, 17</value>
|
||||
</data>
|
||||
@@ -589,6 +586,30 @@
|
||||
<data name=">>btnOK.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Bottom</value>
|
||||
</data>
|
||||
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 385</value>
|
||||
</data>
|
||||
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>642, 60</value>
|
||||
</data>
|
||||
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name=">>panel2.Name" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>panel2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Top</value>
|
||||
</data>
|
||||
@@ -620,7 +641,7 @@
|
||||
<value>7, 17</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>642, 434</value>
|
||||
<value>642, 445</value>
|
||||
</data>
|
||||
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>6, 8, 6, 8</value>
|
||||
|
||||
@@ -175,4 +175,7 @@
|
||||
<data name="chkEnableTun.Text" xml:space="preserve">
|
||||
<value>启用 tun 模式 (以管理员身份运行)</value>
|
||||
</data>
|
||||
<data name="chkEnableConvert.Text" xml:space="preserve">
|
||||
<value>启用订阅转换</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -18,6 +18,7 @@ namespace clashN
|
||||
/// </summary>
|
||||
public const string SpeedTestUrl = @"http://cachefly.cachefly.net/10mb.test";
|
||||
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
|
||||
public const string SubConvertUrl = @"https://sub.xeton.dev/sub?target=clash&url={0}";
|
||||
|
||||
/// <summary>
|
||||
/// PromotionUrl
|
||||
|
||||
@@ -90,6 +90,10 @@ namespace clashN.Handler
|
||||
{
|
||||
config.constItem = new ConstItem();
|
||||
}
|
||||
if (Utils.IsNullOrEmpty(config.constItem.subConvertUrl))
|
||||
{
|
||||
config.constItem.subConvertUrl = Global.SubConvertUrl;
|
||||
}
|
||||
if (Utils.IsNullOrEmpty(config.constItem.speedTestUrl))
|
||||
{
|
||||
config.constItem.speedTestUrl = Global.SpeedTestUrl;
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace clashN.Handler
|
||||
return;
|
||||
}
|
||||
var urlBase = $"{Global.httpProtocol}{Global.Loopback}:{LazyConfig.Instance.GetConfig().APIPort}/proxies";
|
||||
urlBase += @"/{0}/delay?timeout=10000&url=" + Global.SpeedPingTestUrl;
|
||||
urlBase += @"/{0}/delay?timeout=10000&url=" + LazyConfig.Instance.GetConfig().constItem.speedPingTestUrl;
|
||||
|
||||
foreach (KeyValuePair<string, ProxiesItem> kv in proxies)
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace clashN.Handler
|
||||
{
|
||||
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
|
||||
int responseTime = -1;
|
||||
string status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out responseTime);
|
||||
string status = GetRealPingTime(LazyConfig.Instance.GetConfig().constItem.speedPingTestUrl, webProxy, out responseTime);
|
||||
bool noError = Utils.IsNullOrEmpty(status);
|
||||
return noError ? responseTime : -1;
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ namespace clashN.Handler
|
||||
private const string clashCoreUrl32 = Global.clashCoreUrl + "/download/{0}/clash-windows-386-{0}.zip";
|
||||
private const string clashCoreUrl64 = Global.clashCoreUrl + "/download/{0}/clash-windows-amd64-{0}.zip";
|
||||
private readonly string clashMetaCoreLatestUrl = Global.clashMetaCoreUrl + "/latest";
|
||||
private const string clashMetaCoreUrl32 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-386.zip";
|
||||
private const string clashMetaCoreUrl64 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-amd64V1.zip";
|
||||
private const string clashMetaCoreUrl32 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-386-{0}.zip";
|
||||
private const string clashMetaCoreUrl64 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-amd64V1-{0}.zip";
|
||||
private const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
||||
|
||||
public void CheckUpdateGuiN(Config config, Action<bool, string> update)
|
||||
@@ -180,6 +180,8 @@ namespace clashN.Handler
|
||||
return;
|
||||
}
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
foreach (var item in config.profileItems)
|
||||
{
|
||||
if (item.enabled == false)
|
||||
@@ -197,9 +199,12 @@ namespace clashN.Handler
|
||||
continue;
|
||||
}
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
|
||||
|
||||
if (item.enableConvert)
|
||||
{
|
||||
url = String.Format(config.constItem.subConvertUrl, Utils.UrlEncode(url));
|
||||
}
|
||||
var result = await (new DownloadHandle()).DownloadStringAsync(url, blProxy, userAgent);
|
||||
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgGetSubscriptionSuccessfully}");
|
||||
@@ -213,14 +218,16 @@ namespace clashN.Handler
|
||||
int ret = ConfigHandler.AddBatchProfiles(ref config, result, indexId, groupId);
|
||||
if (ret == 0)
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgUpdateSubscriptionEnd}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgFailedImportSubscription}");
|
||||
}
|
||||
_updateFunc(true, $"{hashCode}{ResUI.MsgUpdateSubscriptionEnd}");
|
||||
});
|
||||
_updateFunc(true, $"-------------------------------------------------------");
|
||||
}
|
||||
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -176,6 +176,8 @@ namespace clashN.Mode
|
||||
} = string.Empty;
|
||||
|
||||
public bool enableTun { get; set; }
|
||||
|
||||
public bool enableConvert { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
@@ -197,16 +199,14 @@ namespace clashN.Mode
|
||||
[Serializable]
|
||||
public class ConstItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义配置文件下载测速url
|
||||
/// </summary>
|
||||
public string subConvertUrl
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string speedTestUrl
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 自定义“配置文件真连接延迟”测试url
|
||||
/// </summary>
|
||||
public string speedPingTestUrl
|
||||
{
|
||||
get; set;
|
||||
|
||||
@@ -373,7 +373,7 @@ namespace clashN
|
||||
|
||||
public static string UrlEncode(string url)
|
||||
{
|
||||
return HttpUtility.UrlEncode(url);
|
||||
return Uri.EscapeDataString(url);
|
||||
}
|
||||
public static string UrlDecode(string url)
|
||||
{
|
||||
@@ -735,16 +735,12 @@ namespace clashN
|
||||
{
|
||||
if (enableSecurityProtocolTls13)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
|
||||
| SecurityProtocolType.Tls11
|
||||
| SecurityProtocolType.Tls12
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
|
||||
| SecurityProtocolType.Tls13;
|
||||
}
|
||||
else
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
|
||||
| SecurityProtocolType.Tls11
|
||||
| SecurityProtocolType.Tls12;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
}
|
||||
ServicePointManager.DefaultConnectionLimit = 256;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user