gpt4 book ai didi

C# 使用 Privoxy/TOR

转载 作者:太空宇宙 更新时间:2023-11-03 16:51:07 31 4
gpt4 key购买 nike

我发现很多示例如何使用 Privoxy/TOR 作为代理。例如:How to use Tor to make a C# HttpWebRequest

首先,我安装了 Vidalia Bundle,然后还安装了 Privoxy。

Vidalia Bundle 使用地址 127.0.0.1:9115
Privoxy 使用地址 127.0.0.1:8118

我尝试用代码在服务器上创建请求 http://whatismyipaddress.com/ .

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://whatismyipaddress.com/");
request.Proxy = new WebProxy("127.0.0.1:8118");

using (var response = request.GetResponse())
{
using (var reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("utf-8")))
{
webBrowser1.DocumentText = reader.ReadToEnd();
}
}

但是这个服务器仍然看到我的 IP 地址。我做错了什么?任何预付款,谢谢。

编辑,有 leppie 的建议:我使用这个构造函数:

   request.Proxy = new WebProxy("127.0.0.1",8118); 

但服务器仍然看到我的 IP 地址。 :(

应用程序在端口 8118 上使用 Privoxy。我需要在 9115 上转发 - 这是 TOR 端口。

最佳答案

我怀疑网址有误。

您可能应该使用 WebProxy(string Host, int Port) 构造函数。

关于C# 使用 Privoxy/TOR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3960114/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com