Rev2054, Outgoing socket binding support

This commit is contained in:
shortcutme 2017-04-14 16:05:42 +02:00
parent c5629adf23
commit fae5d22e86
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
4 changed files with 25 additions and 4 deletions

View file

@ -98,8 +98,7 @@ class Connection(object):
raise Exception("Can't connect to onion addresses, no Tor controller present")
self.sock = self.server.tor_manager.createSocket(self.ip, self.port)
else:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((self.ip, int(self.port)))
self.sock = socket.create_connection((self.ip, int(self.port)))
# Implicit SSL
if self.cert_pin: