OpenBazaar/OpenBazaar — pull request #860 by El--Presidente (2014-10-25 11:42:25+00:00)
Title: [WIP] Native Tor support

This PR is intended to add Native Tor support to OpenBazaar.

Given that zmq does not support name resolution via SOCKS it has been necessary to create a small TCP redirector within PeerConnection that allows zmq sockets to be routed via SOCKS/Tor.

Currently this PR will route all zmq connections to nodes with '.onion' URIs via Tor successfully. Nodes cannot connect back yet because our URI is still set to a public address.

Summary of changes:
1) socksiPy-branch has been added to requirements.txt
2) A utility library file called tor_util.py has been created that currently contains a single class - TorRedirector
3) PeerConnection._initiate_connection in connection.py has been modified to call TorRedirector when a zmq peerconnection via Tor is required

Outstanding changes:
1) Within transport.py allow for my_uri to be set to the users Tor hidden service hostname when in 'tor mode' - e.g. the form tcp://abcdefg123456.onion:12345
2) Allow for binding the server to localhost (currently openbazaar launcher prohibits this)
3) Completion of --tor-mode parameter on the command line or another way of specifying a '.onion' hostname as your nodes IP. See #795