Skip to content

Commit

Permalink
Change socks_socket to socks_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
david415 committed Aug 29, 2016
1 parent 3cc23fc commit 594e8ed
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions txtorcon/endpoints.py
Expand Up @@ -32,7 +32,6 @@
from twisted.internet.endpoints import serverFromString
from twisted.internet.endpoints import clientFromString
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.endpoints import UNIXClientEndpoint
from twisted.internet import error
from twisted.plugin import IPlugin
from twisted.python.util import FancyEqMixin
Expand Down Expand Up @@ -668,7 +667,7 @@ class TorClientEndpoint(object):
socks_ports_to_try = [9050, 9150]

def __init__(self, host, port,
socks_socket=None,
socks_endpoint=None,
socks_hostname=None, socks_port=None,
socks_username=None, socks_password=None,
_proxy_endpoint_generator=default_tcp4_endpoint_generator):
Expand All @@ -678,7 +677,7 @@ def __init__(self, host, port,
self.host = host
self.port = int(port)
self._proxy_endpoint_generator = _proxy_endpoint_generator
self.socks_socket = socks_socket
self.socks_endpoint = socks_endpoint
self.socks_hostname = socks_hostname
self.socks_port = int(socks_port) if socks_port is not None else None
self.socks_username = socks_username
Expand All @@ -694,9 +693,8 @@ def __init__(self, host, port,
@defer.inlineCallbacks
def connect(self, protocolfactory):
last_error = None
if self.socks_socket is not None:
tor_ep = UNIXClientEndpoint(reactor, self.socks_socket)
args = (self.host, self.port, tor_ep)
if self.socks_endpoint is not None:
args = (self.host, self.port, self.socks_endpoint)
kwargs = dict()
socks_ep = SOCKS5ClientEndpoint(*args, **kwargs)
proto = yield socks_ep.connect(protocolfactory)
Expand Down

0 comments on commit 594e8ed

Please sign in to comment.