CONFIGURATION TO MAKE BUNDLED TOR CONNECT TO ANOTHER TOR ON LOCALHOST ("SYSTEM TOR") Example use: for transparent proxy installation https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy Warning: this might reveal content to exit node - need review! =============================================================================== We want to bind local tor, bundled with torchat to system tor. Motivation for this is that bundled tor runs as given user and does not need system permission to edit hiddenservice for chat. For that we build new enough tor binary to support "Socks5Proxy" configuration option to use system tor as proxy. https://gitweb.torproject.org/tor.git/blob/HEAD:/doc/tor.1.txt **Socks5Proxy** __host__[:__port__]:: Tor will make all OR connections through the SOCKS 5 proxy at host:port (or host:1080 if port is not specified). Thanks to 'asn' on #tor ! =============================================================================== This was tested on debian 6 with http://code.google.com/p/torchat/downloads/detail?name=torchat-source-0.9.9.534.zip install build tools and necessary -dev libs: sudo apt-get install libevent-dev libssl-dev build-essential unpack https://www.torproject.org/dist/tor-0.2.2.28-beta.tar.gz or later inside torchat dir inside that dir configure and make ./configure && make end of build displays: make[2]: Nothing to be done for `all-am'. make[2]: Leaving directory `/home/user/torchat/tor-0.2.2.28-beta' make[1]: Leaving directory `/home/user/torchat/tor-0.2.2.28-beta' edit torchat/Tor/tor.sh replace tor -f torrc.txt --PidFile tor.pid & with path to this new build ~/torchat/tor-0.2.2.28-beta/src/or/tor -f torrc.txt --PidFile tor.pid & system tor /etc/tor/torrc has: SocksPort 9050 # what port to open for local application connections SocksListenAddress 127.0.0.1 # accept connections only from localhost so we add to torchat/Tor/torrc Socks5Proxy 127.0.0.1:9050 HTTPProxy 127.0.0.1:8118 # use 'system tor' polipo http proxy for directory requests we edit /etc/polipo/config which comes with debian tor installation from sample config https://gitweb.torproject.org/torbrowser.git/blob_plain/HEAD:/build-scripts/config/polipo.conf - or just copy this config proxyAddress = "127.0.0.1" proxyPort = 8118 # Uncomment this if you want to use a parent SOCKS proxy: socksParentProxy = "localhost:9050" socksProxyType = socks5 ### On-disk data ### ************ # Uncomment this if you want to disable the on-disk cache: diskCacheRoot = "" # Suggestions from Incognito configuration maxConnectionAge = 5m maxConnectionRequests = 120 serverMaxSlots = 8 serverSlots = 2 tunnelAllowedPorts = 1-65535 restart polipo: sudo /etc/init.d/polipo restart we start torchat from terminal and we get [notice] Tor v0.2.2.28-beta (git-e084c6fd14caba95). This is experimental software. Do not rely on it for strong anonymity. (Running on Linux i686) [notice] Initialized libevent version 1.4.13-stable using method epoll. Good. [notice] Opening Socks listener on 127.0.0.1:11109 [notice] OpenSSL OpenSSL 0.9.8o 01 Jun 2010 looks like version 0.9.8m or later; I will try SSL_OP to enable renegotiation [notice] We now have enough directory information to build circuits. [notice] Bootstrapped 80%: Connecting to the Tor network. [notice] Bootstrapped 85%: Finishing handshake with first hop. [notice] Bootstrapped 90%: Establishing a Tor circuit. [notice] Tor has successfully opened a circuit. Looks like client functionality is working. [notice] Bootstrapped 100%: Done. we still sometimes get [warn] Received http status code 403 ("Forbidden port") from server '....:443' while fetching "/tor/server/d/......z". I'll try again soon. tested with someone, and it seems to be working. got request and chat works. UPDATE 1: to make another test instance, change second bundle's tor socks port, second application port, but do not change 'outside port' of hidden service, only local ports. takes a few minutes to init, but then it works... torchat/torchat.ini tor_server_socks_port = 11209 must match torchat/Tor/torrc.txt SocksPort 11209 torchat/Tor/torrctxt HiddenServicePort 11009 127.0.0.1:21109 must match torchat/torchat.ini listen_port = 21109 of course, if you copy directory already configured, remove files in torchat/Tor/hidden_service