This project is suitable for all WebProxy, HTTP Client, WebSocket and for others.
Nuget: https://www.nuget.org/packages/Yove.Proxy/
Install-Package Yove.Proxy
dotnet add package Yove.Proxy
new ProxyClient("138.68.161.60", 1080, ProxyType.Socks5);
new ProxyClient("138.68.161.60:1080", ProxyType.Socks5);
new ProxyClient("138.68.161.60:1080", "UserID / Username", ProxyType.Socks4);
new ProxyClient("138.68.161.60:1080", "Username", "Password", ProxyType.Socks5);
ClientWebSocket WebSocket = new ClientWebSocket
{
Options.Proxy = new ProxyClient("138.68.161.60", 1080, ProxyType.Socks4)
};
await WebSocket.ConnectAsync(new Uri("wss://echo.websocket.org"), TokenSource.Token);
HttpClientHandler Handler = new HttpClientHandler
{
Proxy = new ProxyClient("138.68.161.60", 1080, ProxyType.Socks4),
Proxy = new ProxyClient("159.224.243.185:61303", ProxyType.Socks4)
{
ReadWriteTimeOut = 30000 // 30 seconds [Default 60 seconds]
}
};
using (HttpClient Client = new HttpClient(Handler))
{
string Response = await Client.GetStringAsync("https://api.ipify.org/?format=json");
Console.WriteLine(Response);
}
If you are missing something in the library, do not be afraid to write me :)