I'm on a device where certain hostnames are blocked at an operating system level, so even If I go to a different network, the hostnames are blocked as well. This is also the case for using command-line tools like curl
, etc. which makes sense.
One way to bypass this web filter is by using the Tor browser, and you would think that the logical thing to make it work in the command line is to use torsocks
.
I have torsocks
installed, but if I use it to try and access a restricted hostname, it gives a socket is not connected
error.
A quick search shows that the ports are being properly used, but torsocks
just isn't working.
Here's a quick example:
mojang
is one of the blocked hostnames, so if I run brew install --cask minecraft
It normally gives this error:
==> Downloading https://launcher.mojang.com/download/Minecraft.dmg
curl: (35) Recv failure: Socket is not connected
Error: Download failed on Cask 'minecraft' with message: Download
failed: https://launcher.mojang.com/download/Minecraft.dmg
When I run the same command under torsocks [torsocks brew install Minecraft
] it returns the same error, even though it shouldn't.
One more thing: I installed torsocks using homebrew so I can't find the configuration file. I looked for it and tried googling where it was but I don't know where homebrew installs configuration files. (I can't find the tor.conf file in the place it usually is, where a quick google search tells it to be.)
Is there anything I can do to adjust torsocks
where it will allow me to run these commands with restricted hostnames?