C#
Languages & HTTP Clients
C# / .NET (HttpClient) proxy integration
.NET routes HttpClient traffic through a WebProxy configured on the HttpClientHandler. Set the Aethyn endpoint and credentials, and every request exits through a residential IP.
Setup steps
- 1Create a WebProxy pointing at proxy.aethyn.io:2099.
- 2Set Credentials with your Aethyn username (incl. targeting) and password.
- 3Attach the proxy to an HttpClientHandler.
- 4Use that handler when constructing HttpClient.
Code
HttpClient with WebProxy
using System.Net;
using System.Net.Http;
var proxy = new WebProxy("http://proxy.aethyn.io:2099")
{
Credentials = new NetworkCredential(
"aethyn-XXXXX-country-us", "PASSWORD")
};
var handler = new HttpClientHandler { Proxy = proxy, UseProxy = true };
using var client = new HttpClient(handler);
var body = await client.GetStringAsync("https://httpbin.org/ip");
Console.WriteLine(body);Replace aethyn-XXXXX and PASSWORD with your dashboard credentials. See the full targeting reference and protocol/port list.
Tips
- Reuse one HttpClient instance for the app's lifetime.
- Put targeting suffixes in the NetworkCredential username.
- Set Timeout on the HttpClient to avoid hanging requests.
C# / .NET (HttpClient) proxy FAQ
Does HttpClient support authenticated proxies?
Yes. Set the WebProxy.Credentials to a NetworkCredential with your Aethyn username and password.
Docs, solutions & blog
Premium residential proxiesCost-efficient rotating residential pool from €2.00/GB for bulk scraping and monitoring.Elite residential proxiesCurated high-trust pool with city and ISP targeting for hard anti-bot targets.Quickstart docsCredentials, endpoints, and your first proxied request.Proxy glossaryPlain-English definitions for residential proxies, rotation, anti-bot, and scraping terms.