By default, Oxylabs proxies and Proxy Rotator use a basic HTTP authentication that requires you to provide a username and password. You can get your credentials by contacting your Dedicated Account Manager or our Support Team at support@oxylabs.io.
We also support authentication based on whitelisted IP addresses; see Whitelisting IPs. Depending on your authentication method, you might need to change the proxy port.
Proxy Port
Usage
60000
This port is required with proxies when login credentials are used (username and password). It is also used with with both login credentials and whitelisted IPs.
65432
Required with proxies when authorization is done via whitelisted IPs.
Code examples
If you want to use Dedicated Datacenter Proxies via username and password authentication method:
using System;
using System.Net;
class Example
{
static void Main()
{
var proxy = new WebProxy
{
Address = new Uri($"http://1.2.3.4:60000"),
BypassProxyOnLocal = false,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("username", "password")
};
var handler = new HttpClientHandler
{
Proxy = proxy,
};
HttpClient client = new HttpClient(handler);
var task = Task.Run(async () =>
{
var response = await client.GetAsync("https://ip.oxylabs.io/location");
var content = response.Content;
var result = await content.ReadAsStringAsync();
return result;
});
task.Wait();
Console.WriteLine(task.Result);
}
}
If you want to use Dedicated Datacenter Proxies via Whitelisted IP authentication method:
using System;
using System.Net;
class Example
{
static void Main()
{
var proxy = new WebProxy
{
Address = new Uri($"http://1.2.3.4:65432"),
BypassProxyOnLocal = false,
UseDefaultCredentials = false,
};
var handler = new HttpClientHandler
{
Proxy = proxy,
};
HttpClient client = new HttpClient(handler);
var task = Task.Run(async () =>
{
var response = await client.GetAsync("https://ip.oxylabs.io/location");
var content = response.Content;
var result = await content.ReadAsStringAsync();
return result;
});
task.Wait();
Console.WriteLine(task.Result);
}
}