Add proxy authentication
- proxy module was missing initialisation of authentication
This commit is contained in:
parent
ff9634141e
commit
757740369b
|
@ -3,6 +3,7 @@ import time
|
||||||
|
|
||||||
from advanceddispatcher import AdvancedDispatcher
|
from advanceddispatcher import AdvancedDispatcher
|
||||||
import asyncore_pollchoose as asyncore
|
import asyncore_pollchoose as asyncore
|
||||||
|
from bmconfigparser import BMConfigParser
|
||||||
from debug import logger
|
from debug import logger
|
||||||
import network.connectionpool
|
import network.connectionpool
|
||||||
import state
|
import state
|
||||||
|
@ -87,6 +88,11 @@ class Proxy(AdvancedDispatcher):
|
||||||
self.isOutbound = True
|
self.isOutbound = True
|
||||||
self.fullyEstablished = False
|
self.fullyEstablished = False
|
||||||
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
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:
|
if address.host.endswith(".onion") and self.onion_proxy is not None:
|
||||||
self.connect(self.onion_proxy)
|
self.connect(self.onion_proxy)
|
||||||
else:
|
else:
|
||||||
|
|
Reference in New Issue
Block a user