SourceForge Logo

tsocks Overview
SOCKS servers are a form of proxy that are commonly used in firewalled LAN environments to allow access between networks, and often to the Internet. The problem is that most applications don't know how to gain access through SOCKS servers. This means that network based applications that don't understand SOCKS are very limited in networks they can reach. An example of this is simple 'telnet'. If you're on a network firewalled from the internet with a SOCKS server for outside access, telnet can't use this server and thus can't telnet out to the Internet.

tsocks' role is to allow these non SOCKS aware applications (e.g telnet, ssh, ftp etc) to use SOCKS without any modification. It does this by intercepting the calls that applications make to establish network connections and negotating them through a SOCKS server as necessary.

tsocks Internally
tsocks is based on the 'shared library interceptor' concept. Through use of the LD_PRELOAD environment variable or the /etc/ld.so.preload file tsocks is automatically loaded into the process space of every executed program. From there it overrides the normal connect() function by providing its own. Thus when an application calls connect() to establish a TCP connection it instead passes control to tsocks. tsocks determines if the connection needs to be made via a SOCKS server (by checking /etc/tsocks.conf) and negotiates the connection if so (through use of the real connect() function )

tsocks Licensing
tsocks is licensed under the GNU General Public License Version 2. A copy of this license is provided in the source distribution and it can also be viewed online here. Essentially this license allows anyone to use tsocks for any purpose, but the code must always remain open, i.e the code cannot be included in any closed source product.

Other tsocks like products
Several other products exist that do what tsocks does. They all either have far more restricitive licencing than tsocks or are much more heavyweight than tsocks. However, incase you're interested in comparing, some of these products are listed here:
  • NEC SOCKS Version 5 Reference Implementation - NEC invented the SOCKS protocol. They provide this SOCKS Version 5 reference implementation which includes a utility called runsocks that achieves much the same goal as tsocks. Note that licensing of this product allows free use only for non commercial applications.
  • Dante - This is a free implementation of a SOCKS server (4 and 5) and client suite. Dante is significantly more heavyweight than tsocks but is worth a look.
I'm always interested in hearing about other tsocks like products so feel free to email them to me at delius at progsoc nospam dot org