C-Sharp
In this example, we use the Residential proxy below:
resi.ipv6.plainproxies.com:8080:customer:product--resi6--pass--nicepass
This proxy is split into four parts separated by colons. We first save the proxy as a string variable, then split it into four parts at each colon (:) and then add it, with authentication, to our proxy dictionary.
using System;
using System.Net;
using System.IO;
class Program
{
static void Main(string[] args)
{
string proxyAddress = "resi.ipv6.plainproxies.com:8080";
string proxyUsername = "customer";
string proxyPassword = "product--resi6--pass--nicepass";
WebProxy proxy = new WebProxy(proxyAddress, true);
proxy.Credentials = new NetworkCredential(proxyUsername, proxyPassword);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://google.com");
request.Proxy = proxy;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string responseText = reader.ReadToEnd();
Console.WriteLine(responseText);
}
}