Tor Browser

Hi all,
I just found this nuget with respository and would like to implement in vl gamma.

There is an example using Privoxy proxy, which I started to implement but I get stuck specially in the last part of the code to migrate into vl gamme. Can somebody help to finish the vl gamma patch please?

// configure
var settings = new TorSharpSettings
{
ZippedToolsDirectory = Path.Combine(Path.GetTempPath(), “TorZipped”),
ExtractedToolsDirectory = Path.Combine(Path.GetTempPath(), “TorExtracted”),
PrivoxySettings = { Port = 1337 },
TorSettings =
{
SocksPort = 1338,
ControlPort = 1339,
ControlPassword = “foobar”,
},
};

// download tools
await new TorSharpToolFetcher(settings, new HttpClient()).FetchAsync();

// execute
var proxy = new TorSharpProxy(settings);
var handler = new HttpClientHandler
{
Proxy = new WebProxy(new Uri(“http://localhost:” + settings.PrivoxySettings.Port))
};
var httpClient = new HttpClient(handler);
await proxy.ConfigureAndStartAsync();
Console.WriteLine(await httpClient.GetStringAsync(“http://api.ipify.org”));
await proxy.GetNewIdentityAsync();
Console.WriteLine(await httpClient.GetStringAsync(“http://api.ipify.org”));
proxy.Stop();

thanks !!!

Privoxy.vl (37.1 KB)

This is a tricky one to translate because of the heave usage of await - we have no direct translation of that C# language feature in VL. Might I ask what you plan to do? Because if you only want to run that particular code I’d suggest setting up a C# helper project, wrapping that code in a public static async Task DownloadAsync(string url, int port, string password, ...) { // Your example code using the passed parameters } method, and calling that from VL.

Hi thank you for you reply.

Wrapping the code in C# would do the trick.
With the above code I would like to change my IP address everytime after “await proxy.ConfigureAndStartAsync();” is called.

I would like to use VL for data scraping and sometimes I get blocked by the server because of to many web requests.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.