WIP: Add support for tor using PySocks and optionally stem #2

Draft
lee.miller wants to merge 22 commits from lee.miller/MiNode:tor into v0.3
2 changed files with 12 additions and 9 deletions
Showing only changes of commit 8c1454e572 - Show all commits

View File

@ -271,7 +271,7 @@ def main():
'Error while creating data directory in: %s', 'Error while creating data directory in: %s',
shared.data_directory, exc_info=True) shared.data_directory, exc_info=True)
if shared.socks_proxy: if shared.socks_proxy and shared.send_outgoing_connections:
try: try:
socks.PROXY_TYPES[shared.socks_proxy.scheme.upper()] socks.PROXY_TYPES[shared.socks_proxy.scheme.upper()]
except KeyError: except KeyError:

View File

@ -75,6 +75,9 @@ def start_tor_service():
logging.debug('Failed to start tor.') logging.debug('Failed to start tor.')
return return
if not shared.listen_for_connections:
return True
try: try:
controller = stem.control.Controller.from_socket_file(control_socket) controller = stem.control.Controller.from_socket_file(control_socket)
controller.authenticate() controller.authenticate()