Torsocks acts as a network wrapper around linux applications. This allows them to work on the Tor network where that might not normally be possible. If the application that you are working with already has functionality that allows it to take advantage of a SOCKS5 proxy, then you can use Tor's built in proxy to do that. However if the application doesn't have that functionality, you can try to use Torsocks instead.
Note:
A word about anonymity. The point of the Tor network is to be anonymous. If you want to maximize anonymity, use the Tor Browser. However, sometimes you need to do things that the Tor browser can't do easily. In this post, I'm going to focus on using Torsocks with curl ([cURL](https://curl.se/)) and wget. Both of these tools are miminal web clients. While they can be fingerprinted as being not Tor Browser, the actual amount of metadata they provide is pretty tiny and it would be incredibly difficult to de-anonymize someone using them for basic downloads.
The first thing that you need to do is to install the tor daemon and torsocks to your linux distro. Here are a couple of example of how to do that:
Debian/Ubuntu
```
sudo apt install tor torsocks
```
openSUSE
```
sudo zypper in tor torsocks
```
You can then enable and start the tor daemon by running:
```
sudo systemctl enable --now tor
```
Once the systemd service is started, you can use torsocks. There is no reason to edit the torrc file or anything else. Let's get the current weather using curl and torsocks:
```
torsocks curl wttr.in
Weather report: Amsterdam, Netherlands
\ / Partly cloudy
_ /"".-. +7(5) °C
\_( ). ↘ 15 km/h
/(___(__) 10 km
0.5 mm
┌─────────────┐
┌──────────────────────────────┬───────────────────────┤ Fri 05 Jan ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
I'm not in Amsterdam, so why did it give me the weather for Amsterdam? Because that's where the Tor exit node is. If I change the url for the weather from `torsocks curl wttr.in` to `torsocks curl wttr.in/chicago`, I will get the weather for Chicago. This is just a very simple example of how to use torsock with curl.
wget works the same way. Let's get an ebook copy of the US Constitution from Project Gutenberg in epub format.
In this example, I just used wget as a downloader against the url of the ebook and I used the -O flag to specify the filename that I wanted it saved to.
One final note, if the website that you want to use curl, wget, or any other tool or application against does not allow Tor users, then this will not work. There's no silver bullet to getting around those IP blocks.