Update TorManager.py

This commit is contained in:
MuxZeroNet 2017-02-23 23:09:47 +00:00 committed by GitHub
parent ad900479f6
commit a724dd472f
1 changed files with 4 additions and 2 deletions

View File

@ -292,11 +292,13 @@ class TorManager(object):
self.log.debug("Created new hidden service for %s: %s" % (site_address, onion))
return onion
# Creates and returns a
# socket that has conencted to the Tor Network
def createSocket(self, onion, port):
if not self.enabled:
return False
self.log.debug("Creating new socket to %s:%s" % (onion, port))
if config.tor == "always": # Every socket is proxied by default
self.log.debug("Creating new Tor socket to %s:%s" % (onion, port))
if config.tor == "always": # Every socket is proxied by default, in this mode
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((onion, int(port)))
else: