Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

curl

windows

tor

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/
like image 472
VolatileRig Avatar asked Aug 23 '11 20:08

VolatileRig


2 Answers

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

like image 52
Marc B Avatar answered Sep 28 '22 03:09

Marc B


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.

like image 36
VolatileRig Avatar answered Sep 28 '22 03:09

VolatileRig