Proxy 在命令行中使用http代理包装tor socks代理

Proxy 在命令行中使用http代理包装tor socks代理,proxy,tor,socks,Proxy,Tor,Socks,我已经通过apt安装了tor,它正在监听端口号9050 # netstat -ntlup | grep tor tcp 0 0 127.0.0.1:9050 0.0.0.0:* LISTEN 13566/tor 由于tor是一个socks代理,我想使用它作为http代理,所以我通过apt安装了polipo,并按如下方式进行了配置 # cat /etc/polipo/config logSyslog

我已经通过
apt
安装了
tor
,它正在监听端口号9050

# netstat -ntlup | grep tor
tcp        0      0 127.0.0.1:9050          0.0.0.0:*               LISTEN      13566/tor       
由于tor是一个socks代理,我想使用它作为http代理,所以我通过
apt
安装了
polipo
,并按如下方式进行了配置

# cat /etc/polipo/config 
logSyslog = true
logFile = /var/log/polipo/polipo.log
allowedClients = 127.0.0.1, 192.168.1.0/24 # Expose your network (modify accordingly)
socksParentProxy = "localhost:9050"
socksProxyType = socks5
proxyAddress = "0.0.0.0"    # IPv4 only
然后我重新启动了
tor
polipo
服务。
polipo
日志说它正在监听端口号8123,这听起来很奇怪

我知道我必须为
http\u proxy
https\u proxy
设置变量。所以

# export http_proxy=127.0.0.1:9050 https_proxy=127.0.0.1:9050
但是,
wget
命令无法到达站点,出现以下错误

 # wget https://torproject.org
 --2018-03-29 21:14:28--  https://torproject.org/
Connecting to 127.0.0.1:9050... connected.
Proxy tunneling failed: Tor is not an HTTP ProxyUnable to establish SSL connection.
配置有什么问题?我需要找到一种方法让
wget
在bash脚本中使用它

[1] 您应该更改:

export http_proxy=127.0.0.1:9050 https_proxy=127.0.0.1:9050

将代理环境变量设置为Tor的SOCKS代理,而不是polipo HTTP代理

如果您从
apt
安装了Tor,您还可以尝试:

torify wget https://torproject.org
这将强制您运行的任何程序使用Tor的SOCKS代理

或者,只需使用内置袜子支撑的卷发:

curl --socks5-hostname 127.0.0.1:9050 https://torproject.org/
curl --socks5-hostname 127.0.0.1:9050 https://torproject.org/