Step 1 : Installing
Simply extract the tarball, then, use the magic spell everyone familiar with to install it.
sudo make install
Afterwards, create a config file named tsocks.conf in /etc/ . Refer the examples given together with the source tarball for guidance on how to write the config. For those who just want a quick and basic config and lazy to open the examples, I've provided it below.
# This is the configuration for libtsocks (transparent socks)
# Lines beginning with # and blank lines are ignored
# This sample configuration shows the simplest (and most common) use of
# tsocks. This is a basic LAN, this machine can access anything on the
# local ethernet (192.168.0.*) but anything else has to use the SOCKS version
# 4 server on the firewall. Further details can be found in the man pages,
# tsocks(8) and tsocks.conf(5) and a more complex example is presented in
# We can access 192.168.0.* directly
local = 192.168.0.0/255.255.255.0
# Otherwise we use the server
server = 192.168.0.1
Step 2 : Using the library
To make an application to use tsocks, using a terminal, simply do this
export LD_PRELOAD=/lib/libtsocks.sobefore executing the application from the terminal. Note that environment variable export only works on the terminal which you export the value.
Alternatives of Tsocks
Transconnect - A HTTP Proxying library similar to Tsocks.
Proxychains - A similar library which supports both HTTP and SOCKS. Also, its able to chain multiple proxies at once.