# Mini-library: SOCKSify all TCPSocket instances

**URL:** <https://www.ruby-forum.com/t/mini-library-socksify-all-tcpsocket-instances/104246>\
**Category:** Ruby\
**Created:** [May 15, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/mini-library-socksify-all-tcpsocket-instances/104246 "2007-05-15T22:23:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://www.ruby-forum.com/u/pure)\
**Post date:** [May 15, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/mini-library-socksify-all-tcpsocket-instances/104246/1 "2007-05-15T22:23:49Z")

</div>

Hello

I wanted to tunnel all TCP connections of a Ruby program through the Tor  
anonymizing proxy. Instead of using tsocks (which is OS depending and  
leaks DNS) I modified TCPSocket directly. Example usage can be seen in  
the lame & only test case.

Get the code with:  
git-clone [http://cthulhu.c3d2.de/~astro/git/socksify-ruby.git](http://cthulhu.c3d2.de/~astro/git/socksify-ruby.git)

Stephan
