HttpToSocks5Proxy
使用.NET HttpClient时,该库允许您通过Socks5代理进行连接。
它实现了IWebProxy接口,因此可以与所有支持HTTP / HTTPS代理的库一起使用。
HttpClient的用法
using MihaZupan ;
var proxy = new HttpToSocks5Proxy ( " 127.0.0.1 " , 1080 );
var handler = new HttpClientHandler { Proxy = proxy };
HttpClient httpClient = new HttpClient ( handler , true );
var result = await httpClient . SendAsync (
new HttpRequestMessage ( HttpMethod .
1