|
|
|
@ -56,7 +56,7 @@ namespace v2rayN.Base
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
public async Task<string> GetAsync(HttpClient client, string url)
|
|
|
|
|
public async Task<string> GetAsync(HttpClient client, string url, CancellationToken token)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(url))
|
|
|
|
|
{
|
|
|
|
@ -64,10 +64,7 @@ namespace v2rayN.Base
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var cts = new CancellationTokenSource();
|
|
|
|
|
cts.CancelAfter(5000);
|
|
|
|
|
|
|
|
|
|
HttpResponseMessage response = await client.GetAsync(url, cts.Token);
|
|
|
|
|
HttpResponseMessage response = await client.GetAsync(url, token);
|
|
|
|
|
return await response.Content.ReadAsStringAsync();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|