How do I use Tor with cURL (in Windows)?

微笑、不失礼 提交于 2020-01-12 03:39:45

问题


I have Vidalia installed, set up Chrome to use port 8118 for the proxy and I've checked my connection through https://check.torproject.org/ but I'm having difficulties getting this work with the command-line tool cURL. This is what I try:

C:\>curl -v --proxy localhost::9050 http://google.com
* About to connect() to proxy localhost port 0 (#0)
* Failed to connect to ↕: Address not available
* No error
*   Trying 127.0.0.1... Failed to connect to 127.0.0.1: Address not available
* No error
* couldn't connect to host
* Closing connection #0
curl: (7) Failed to connect to ↕: Address not available

Solved:

curl -v --socks4a localhost:9050 http://check.torproject.org/

回答1:


Use --socks5 (two dashes). -socks5 is not a valid parameter for curl, so curl is interpreting it as a hostname.




回答2:


Turns out this entire mess was just syntax problems. A proper command is here:

curl -v --socks4a localhost:9050 http://check.torproject.org/

With TWO dashes before socks4a and ONE colon before the port.




回答3:


More updated response using socks5.

curl -v --socks5 localhost:9150 http://check.torproject.org/

So, using port 9150 for socks 5.



来源:https://stackoverflow.com/questions/7167166/how-do-i-use-tor-with-curl-in-windows

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