问题
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