A sample showing how to connect & browse DarkWeb .onion websites using .NET 6.0 in 6 lines of C# code.
Please read the detailed accompanying article which explains the steps and also tips on how to setup Tor for connecting from your .NET application.
Run Torproxy in docker instead of installing locally => TorProxy
Article link here on my blog => Blog Article on sukesh.me
Keep in mind this is the new minimalistic way of writing C# code in .NET 6
SOCKS is a proxy server implementation that can process any TCP or UDP traffic, making it a very versatile system. The implementation is made easier by just using WebProxy by using socks schemes. Also supports Socks4, Socks4a and Socks5.
// Below code snippet shows how to add Socks5 support in code using .NET 6.0
var handler = new HttpClientHandler
{
Proxy = new WebProxy("socks5://127.0.0.1", 9050)
};
var httpClient = new HttpClient(handler);
Thank you Huo Yaoyan for the implementation.