I have TOR setup on my system (debian) that has been tested and works well. What I am trying to do is proxy HTTPS requests through this setup.
just https works: curl https://www.reg.ru/whois/?dname=google.com
Tor + http work curl --socks5 127.0.0.1:9050 http://stackoverflow.com/
but tor with https does not work:
curl --socks5 127.0.0.1:9050 https://www.torproject.org/download/download.html.en
I get an error curl: (6) Failed to resolve "www.torproject.org" for SOCKS5 connect.
How can I solve this?
SOCKS5 is an Internet protocol used by Tor. It sends the traffic through the Tor network instead of sending it from your IP address into the open network. It is a general purpose proxy that sits at the layer 5 of the OSI model and uses the tunneling method.
The line Opening Socks listener on 127.0. 0.1:9050 tells you that it's SOCKS (proxy) port is listening on port 9050. This is the port you want applications like curl or wget to proxy through. As shown in the article you linked, you just need to run curl using Tor's SOCKS port.
To use a proxy with Curl, you must pass the required proxy address using the -x (or --proxy) command-line option and proxy credentials using the -U (or --proxy-user) command-line switch. Proxy credentials may also be passed in the proxy string and will be URL decoded by Curl.
Unlike HTTP proxies, which can only interpret and work with HTTP and HTTPS webpages, SOCKS5 proxies can work with any traffic. HTTP proxies are high-level proxies usually designed for a specific protocol. While this means you get better connection speeds, they're not nearly as flexible and secure as SOCKS proxies.
I had a similar problem, and using the option --socks5-hostname
instead of --socks5
to specify the proxy for curl solved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With