Skip to content

kikashine/Yove.Proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yove.Proxy Socks4/Socks5 for IWebProxy

This project is suitable for all WebProxy, HTTP Client, WebSocket and for others.

NuGet version Downloads Target

Buy Me A Coffee

Nuget: https://www.nuget.org/packages/Yove.Proxy/

Install-Package Yove.Proxy
dotnet add package Yove.Proxy

Example

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);

WebSocket

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);

HttpClient

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);
}

Other

If you are missing something in the library, do not be afraid to write me :)

thesunny@tuta.io

About

Socks4/Socks5 for IWebProxy [WebSocket / HttpClient]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%