Add a "Use proxy for hostname lookup" option

Add a UI option for "Use proxy for hostname lookup" option and plumb
it into libtorrent's settings_pack.proxy_hostnames option.  This is
available for SOCKS5 and HTTP proxies, and defaults to true, which
is the previous functionality.  Hostname lookups can be forced to be
local by unchecking this option, which can aid compatibility with
certain non-compliant proxy servers.

Closes #17902.
PR #17904.

Co-authored-by: Nathan Lewis <saturn@saturn49.dyndns.org>
This commit is contained in:
Nathan Lewis 2022-10-23 02:31:02 -05:00 committed by GitHub
parent 155e73df16
commit f2dd1e6456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 59 additions and 2 deletions

View file

@ -189,6 +189,7 @@ void AppController::preferencesAction()
data[u"proxy_peer_connections"_qs] = session->isProxyPeerConnectionsEnabled();
data[u"proxy_torrents_only"_qs] = proxyManager->isProxyOnlyForTorrents();
data[u"proxy_hostname_lookup"_qs] = session->isProxyHostnameLookupEnabled();
// IP Filtering
data[u"ip_filter_enabled"_qs] = session->isIPFilteringEnabled();
@ -569,6 +570,8 @@ void AppController::setPreferencesAction()
session->setProxyPeerConnectionsEnabled(it.value().toBool());
if (hasKey(u"proxy_torrents_only"_qs))
proxyManager->setProxyOnlyForTorrents(it.value().toBool());
if (hasKey(u"proxy_hostname_lookup"_qs))
session->setProxyHostnameLookupEnabled(it.value().toBool());
// IP Filtering
if (hasKey(u"ip_filter_enabled"_qs))