You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jim Newsome 67cee6c797 Merge branch 'default-allow-syscalls' 2 years ago
config Add hardening compile and linker flags 9 years ago
doc Add a -q/--quiet to torsocks 6 years ago
extras Extras: add bash and zsh completion file 9 years ago
include Add config/ and include/ dir in the repository and update gitignore 10 years ago
src Add debug-log for opaque syscall passthrough 2 years ago
tests gethostbyaddr_r: Don't put garbage in data->hostname 5 years ago
.gitignore Use xz for dist tarball now 6 years ago
.travis.yml Add libtool to .travis.yml 10 years ago
ChangeLog Update version to v2.3.0 4 years ago
INSTALL Update INSTALL file and 9 years ago
LICENSE Fix: add LICENSE file to repository 8 years ago Extras: add bash and zsh completion file 9 years ago Merge remote-tracking branch 'upstream/master' 5 years ago Update INSTALL file and 9 years ago Update version to v2.3.0 4 years ago
gpl-2.0.txt Add gpl v2 license file 9 years ago

Build Status

What is torsocks?

Torsocks allows you to use most applications in a safe way with Tor. It ensures that DNS requests are handled safely and explicitly rejects any traffic other than TCP from the application you're using.

Torsocks is an ELF shared library that is loaded before all others. The library overrides every needed Internet communication libc function calls such as connect(2) or gethostbyname(3).

BE ADVISE: It uses the LD_PRELOAD mechanism (man which means that if the application is not using the libc or for instance uses raw syscalls, torsocks will be useless and the traffic will not go through Tor.

This process is transparent to the user and if torsocks detects any communication that can't go through the Tor network such as UDP traffic, for instance, the connection is denied. If, for any reason, there is no way for torsocks to provide the Tor anonymity guarantee to your application, torsocks will force the application to quit and stop everything.


- autoconf
- automake
- libtool
- gcc


$ ./
$ ./configure
$ make
$ sudo make install

If you are compiling it from the git repository, run ./ before the configure script.

Using torsocks

Once you have installed torsocks, just launch it like so:

$ torsocks [application]

So, for example you can use ssh to a by doing:

$ torsocks ssh

You can use the torsocks library without the script provided:

$ LD_PRELOAD=/full/path/to/ your_app

For more details, please see the torsocks.1, torsocks.8 and torsocks.conf.5 man pages. Also, you can use -h, --help for all the possible options of the torsocks script.

A configuration file named torsocks.conf is also provided for the user to control some parameters.

More informations

torsocks is distributed under the GNU General Public License version 2.

Mailing list for help is and for development use You can find the project also on IRC server (OFTC) in #tor and #tor-dev.

See more information about the Tor project at