在http代理上卷曲.onion url不会返回预期的源

时间:2013-08-09 12:08:26

标签: curl proxy tor polipo

问题

我正在测试包装SOCKS代理(TOR)的HTTP代理。它适用于普通的URL,但是我用一些.onion地址得到了奇怪的结果。

在这个例子中,我指的是“隐藏的维基”。输出看起来像垃圾:

$ curl --proxy localhost:8118 http://kpvz7ki2v5agwt35.onion/

m�AO�@�����ۑp��ĖPbj

背景

使用火炬隐藏服务可以正常工作:

$ curl --proxy localhost:8118 http://xmh57jrzrnw6insl.onion/

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TORCH: Tor Search!</title>...

同样,普通网址似乎没问题:

$ curl --proxy localhost:8118 https://check.torproject.org/ | grep Congratulations

<img alt="Congratulations. Your browser is configured to use Tor." src="/images/tor-on.png">
Congratulations. Your browser is configured to use Tor.<br>

使用polipo创建代理,具有以下配置:

proxyName = "localhost"
proxyAddress = "127.0.0.1"
proxyPort = 8118

allowedClients = 127.0.0.1
allowedPorts = 1-65535

cacheIsShared = false
chunkHighMark = 67108864

socksParentProxy = "localhost:9050"
socksProxyType = socks5


diskCacheRoot = ""
localDocumentRoot = ""

disableLocalInterface = true
disableConfiguration = true
disableVia = true

dnsUseGethostbyname = yes

maxConnectionAge = 5m
maxConnectionRequests = 120

serverMaxSlots = 8
serverSlots = 2

tunnelAllowedPorts = 1-65535

可能的原因

我对可能原因的看法:

  1. 服务器响应垃圾作为某种反网络爬虫 量度。
  2. 我正在处理的方式有问题 响应。
  3. Polipo搞砸了。
  4. 别的......
  5. 思想?

1 个答案:

答案 0 :(得分:1)

有几个问题。首先,您需要确保ntp正在运行并同步。如果没有,你就会遇到这个问题。

如果我可能会问,你为什么不在9050上调用Tor项目提供的袜子端口?

另外,为什么不精确指定您感兴趣的协议,袜子4,4a或5?使用curl,您甚至可以指定dns通过Tor完成。如果您不这样做,那么您的DNS解析器当然不会知道隐藏服务的位置。将此行放在.curlrc文件中

  

proxy = socks5h://127.0.0.1:9050

然后

curl -v http://xmh57jrzrnw6insl.onion/

如果Tor网络没有过载,

将以corectly方式返回页面。检查Tor浏览器以确保隐藏的服务已启动。

相关问题