Socket: Disable resolution when using a SOCKS proxy

1. Avoids leaking DNS queries
2. necessary for onion services
This commit is contained in:
Valentin Lorentz 2021-05-27 00:08:02 +02:00
parent cca1156b90
commit 3bedc86479

View File

@ -269,6 +269,11 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
log.error('Cannot use socks proxy (SocksiPy not installed), ' log.error('Cannot use socks proxy (SocksiPy not installed), '
'using direct connection instead.') 'using direct connection instead.')
socks_proxy = '' socks_proxy = ''
if socks_proxy:
# Do not try to resolve, let the SOCKS proxy do it.
# (Avoids leaking DNS queries *and* is necessary for onion
# services)
address = self.currentServer.hostname
else: else:
try: try:
address = utils.net.getAddressFromHostname( address = utils.net.getAddressFromHostname(