Browse Source

HttpClientHandler -> SocketsHttpHandler for v5

- HttpClientHandler is not used in .NET Core 3+
pull/2977/head
database64128 4 years ago
parent
commit
b65e00c5f1
No known key found for this signature in database GPG Key ID: 1CA27546BEDB8B01
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      shadowsocks-csharp/Controller/Service/OnlineConfigResolver.cs

+ 3
- 2
shadowsocks-csharp/Controller/Service/OnlineConfigResolver.cs View File

@@ -13,11 +13,12 @@ namespace Shadowsocks.Controller.Service
{
public static async Task<List<Server>> GetOnline(string url, IWebProxy proxy = null)
{
var httpClientHandler = new HttpClientHandler()
var socketsHttpHandler = new SocketsHttpHandler()
{
UseProxy = proxy != null,
Proxy = proxy
};
var httpClient = new HttpClient(httpClientHandler)
var httpClient = new HttpClient(socketsHttpHandler)
{
Timeout = TimeSpan.FromSeconds(15)
};


Loading…
Cancel
Save