C# combining GeckoFX + Tor.NET libraries

随声附和 提交于 2019-12-04 18:14:11

Have you set any of the Firefox Preferences in your code before initializing the browser?

Try:

GeckoPreferences.Default["network.proxy.type"] = 1;
GeckoPreferences.Default["network.proxy.socks = "127.0.0.1"
GeckoPreferences.Default["network.proxy.socks_port"] = 9050
GeckoPreferences.Default["network.proxy.socks_remote_dns"] = 1
GeckoPreferences.Default["network.proxy.socks_version"] = 5

The network.proxy.type value of 1 is equivalent to "Manual Proxy Configuration" settings.

The following settings configure the SOCKS proxy settings to use Tor at 127.0.0.1:9050 with DNS resolution over SOCKS (Tor).

It seems like this should properly configure GeckoFX to use Tor.

Tor network is not designed for immediate HTTP proxy communications. Instead, TOR.NET implements web proxy, that listens for connections on port 8182 by default.

Also you can assign another port with

client.Proxy.Port = 8042;

Keep in mind, that if you changes proxy port, TOR.NET shutdowns existing http listener, and creates a new one.

So, you need to configure Gecko, to use this web proxy on localhost.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!