Tag: tor

服务器提交了协议违规。 Section =使用tor代理时的ResponseStatusLine

我正在尝试使用我的asp.net应用程序使用tor代理发送httpwebrequest,并在调用webresponse.GetResponse()方法时收到此错误消息: 服务器提交了协议违规。 第= ResponseStatusLine 我尝试在网上搜索解决方案,我找到了3个主要解决方案: 添加到Web.config。 ` 添加以下行: webRequest.ProtocolVersion = HttpVersion.Version10; 到代码。 添加行request.ServicePoint.Expect100Continue = false; 到代码。 列出的每个解决方案都没有改变错误消息。 这是请求代码: WebRequest.DefaultWebProxy = new WebRequest(“127.0.0.1:9051”); HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); webRequest.CookieContainer = new CookieContainer(); webRequest.ProtocolVersion = HttpVersion.Version10; webRequest.KeepAlive = false; webRequest.Method = “GET”; webRequest.ContentType = “application/x-www-form-urlencoded”; webRequest.Accept = “text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8”; webRequest.UserAgent = “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) […]

C#结合了GeckoFX + Tor.NET库

我正在尝试将GeckoFx库和Tor.NET库结合起来。 在我的代码中,我都准备使用tor网络, ClientCreateParams createParameters = new ClientCreateParams(); createParameters.ConfigurationFile = ConfigurationManager.AppSettings[“torConfigurationFile”]; createParameters.ControlPassword = ConfigurationManager.AppSettings[“torControlPassword”]; createParameters.ControlPort = Convert.ToInt32(ConfigurationManager.AppSettings[“torControlPort”]); createParameters.DefaultConfigurationFile = ConfigurationManager.AppSettings[“torDefaultConfigurationFile”]; createParameters.Path = Path.Combine(root, ConfigurationManager.AppSettings[“torPath”]); createParameters.SetConfig(ConfigurationNames.AvoidDiskWrites, true); createParameters.SetConfig(ConfigurationNames.GeoIPFile, Path.Combine(root, @”Tor\Data\Tor\geoip”)); createParameters.SetConfig(ConfigurationNames.GeoIPv6File, Path.Combine(root, @”Tor\Data\Tor\geoip6″)); client = Client.Create(createParameters); WebBrowser1是一个简单的浏览器,它适用于Tor设置。 但浏览器是GeckoFx,它不起作用。 webBrowser1.Navigate(“https://duckduckgo.com/?q=my+ip&t=h_&ia=answer”); browser.Navigate(“https://duckduckgo.com/?q=my+ip&t=h_&ia=answer”); 如你所见,ip应该像左边的控件一样。 您可以从此处下载并测试完整项目。 WinForms项目只是从解决方案中运行“Gecko”项目。 知道如何设置GeckoFx使用Tor网络吗? 或者我可能需要以某种方式设置GeckoFx来使用代理? //GeckoPreferences.User[“network.proxy.type”] = 1; //GeckoPreferences.User[“network.proxy.socks”] = “127.0.0.1”; //GeckoPreferences.User[“network.proxy.socks_port”] = 9150; //GeckoPreferences.User[“network.proxy.socks_version”] = 5; […]

如何在C#中使用Tor控制协议?

我正在尝试以编程方式将命令发送到Tor控制端口以使其刷新链。 我无法在C#中找到任何示例,我的解决方案无法正常工作。 请求超时。 我有服务正在运行,我可以看到它在控制端口上监听。 public string Refresh() { TcpClient client = new TcpClient(“localhost”, 9051); string response = string.Empty; string authenticate = MakeTcpRequest(“AUTHENTICATE\r\n”, client); if (authenticate.Equals(“250”)) { response = MakeTcpRequest(“SIGNAL NEWNYM\r\n”, client); } client.Close(); return response; } public string MakeTcpRequest(string message, TcpClient client) { client.ReceiveTimeout = 20000; client.SendTimeout = 20000; string proxyResponse = string.Empty; try { […]