diff --git a/src/network/proxy.py b/src/network/proxy.py index 43298f63..1d7ca357 100644 --- a/src/network/proxy.py +++ b/src/network/proxy.py @@ -3,6 +3,7 @@ import time from advanceddispatcher import AdvancedDispatcher import asyncore_pollchoose as asyncore +from bmconfigparser import BMConfigParser from debug import logger import network.connectionpool import state @@ -87,6 +88,11 @@ class Proxy(AdvancedDispatcher): self.isOutbound = True self.fullyEstablished = False self.create_socket(socket.AF_INET, socket.SOCK_STREAM) + if BMConfigParser().safeGetBoolean("bitmessagesettings", "socksauthentication"): + self.auth = (BMConfigParser().safeGet("bitmessagesettings", "socksusername"), + BMConfigParser().safeGet("bitmessagesettings", "sockspassword")) + else: + self.auth = None if address.host.endswith(".onion") and self.onion_proxy is not None: self.connect(self.onion_proxy) else: