-
-
Notifications
You must be signed in to change notification settings - Fork 221
Proxy Configuration
itsokto edited this page May 12, 2020
·
1 revision
var serviceCollection = new ServiceCollection();
// Добавьте сконфигурированный HttpClient в ServiceCollection как Singleton
serviceCollection.AddSingleton(provider =>
{
var httpClientHandler = new HttpClientHandler
{
Proxy = new WebProxy("127.0.0.1", 8888)
};
return new HttpClient(httpClientHandler);
});
// Передайте в конструктор VkApi serviceCollection
var vkApi = new VkApi(serviceCollection);
-
Документация HttpClient