测速网址可配置化

pull/542/head
YFdyh000 2020-02-17 13:46:32 +08:00
parent 11d90dfb68
commit 88d1948b51
3 changed files with 24 additions and 2 deletions

View File

@ -124,6 +124,14 @@ namespace v2rayN.Handler
//{ //{
// config.pacPort = 8888; // config.pacPort = 8888;
//} //}
if (Utils.IsNullOrEmpty(config.speedTestUrl))
{
config.speedTestUrl = Global.SpeedTestUrl;
}
if (Utils.IsNullOrEmpty(config.speedPingTestUrl))
{
config.speedPingTestUrl = Global.SpeedPingTestUrl;
}
if (Utils.IsNullOrEmpty(config.urlGFWList)) if (Utils.IsNullOrEmpty(config.urlGFWList))
{ {
config.urlGFWList = Global.GFWLIST_URL; config.urlGFWList = Global.GFWLIST_URL;

View File

@ -124,7 +124,7 @@ namespace v2rayN.Handler
{ {
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + itemIndex); WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + itemIndex);
int responseTime = -1; int responseTime = -1;
string status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out responseTime); string status = GetRealPingTime(_config.speedPingTestUrl, webProxy, out responseTime);
string output = Utils.IsNullOrEmpty(status) ? string.Format("{0}ms", responseTime) : string.Format("{0}", status); string output = Utils.IsNullOrEmpty(status) ? string.Format("{0}ms", responseTime) : string.Format("{0}", status);
_updateFunc(itemIndex, output); _updateFunc(itemIndex, output);
} }
@ -160,7 +160,7 @@ namespace v2rayN.Handler
Thread.Sleep(5000); Thread.Sleep(5000);
string url = Global.SpeedTestUrl; string url = _config.speedTestUrl;
testCounter = 0; testCounter = 0;
if (downloadHandle2 == null) if (downloadHandle2 == null)
{ {

View File

@ -114,6 +114,20 @@ namespace v2rayN.Mode
get; set; get; set;
} }
/// <summary>
/// 自定义服务器下载测速url
/// </summary>
public string speedTestUrl
{
get; set;
}
/// <summary>
/// 自定义“服务器真连接延迟”测试url
/// </summary>
public string speedPingTestUrl
{
get; set;
}
/// <summary> /// <summary>
/// 自定义GFWList url /// 自定义GFWList url
/// </summary> /// </summary>