From 161f20c1d6351bf9609410d0040096dc7546de49 Mon Sep 17 00:00:00 2001 From: whew <73732390+whew@users.noreply.github.com> Date: Sat, 24 Apr 2021 09:59:53 +0000 Subject: [PATCH 1/2] Use socks5h instead of socks5 With `socks5h` the proxy server resolves the domain name, which avoids leaking DNS requests. --- cli/onionshare_cli/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/onionshare_cli/__init__.py b/cli/onionshare_cli/__init__.py index 1bd0582c..42ec9673 100644 --- a/cli/onionshare_cli/__init__.py +++ b/cli/onionshare_cli/__init__.py @@ -376,8 +376,8 @@ def main(cwd=None): else: (socks_address, socks_port) = onion.get_tor_socks_port() web.proxies = { - "http": f"socks5://{socks_address}:{socks_port}", - "https": f"socks5://{socks_address}:{socks_port}", + "http": f"socks5h://{socks_address}:{socks_port}", + "https": f"socks5h://{socks_address}:{socks_port}", } app = OnionShare(common, onion, local_only, autostop_timer) From 2d28dc9a5e0e941c1ba500775820c11654b0773a Mon Sep 17 00:00:00 2001 From: whew <73732390+whew@users.noreply.github.com> Date: Sat, 24 Apr 2021 10:01:33 +0000 Subject: [PATCH 2/2] Update __init__.py --- desktop/src/onionshare/tab/mode/receive_mode/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/src/onionshare/tab/mode/receive_mode/__init__.py b/desktop/src/onionshare/tab/mode/receive_mode/__init__.py index 5cc72201..464cfcef 100644 --- a/desktop/src/onionshare/tab/mode/receive_mode/__init__.py +++ b/desktop/src/onionshare/tab/mode/receive_mode/__init__.py @@ -275,8 +275,8 @@ class ReceiveMode(Mode): else: (socks_address, socks_port) = self.common.gui.onion.get_tor_socks_port() self.web.proxies = { - "http": f"socks5://{socks_address}:{socks_port}", - "https": f"socks5://{socks_address}:{socks_port}", + "http": f"socks5h://{socks_address}:{socks_port}", + "https": f"socks5h://{socks_address}:{socks_port}", } def start_server_step2_custom(self):