-
Notifications
You must be signed in to change notification settings - Fork 481
Proxy Plugin: DNS Queries through Socks5 Proxy #2364
Description
Expected behaviour:
According to 9dd4e1c#diff-e44affe1ab0e04fc4471a0fe6bfbb08a the proxy plugin should support socks5 and socks5h. Socks5 only uses the proxy for requests. Socks5h should also use the proxy for DNS lookups.
I would expect that I could use socks5h in the config and the DNS requests are routed through the proxy. This would mean that I could run flexget on an isolated network behind a socks5 proxy.
Actual behaviour:
Flexget does not recognize socks5h as proxy URL in the config. When using proxy: socks5h://proxy:9150 in my config file I get:
Path: /templates/global/proxy
Message: u'socks5h://proxy:9150' is not a u'url'
The requests go through the proxy when I use proxy: socks5://proxy:9150 in my config file but only if a dns lookup is possible without the socks5 proxy. The dns lookups are not tunneled through the proxy.
Steps to reproduce:
-
Try to use the proxy string in the config as mentioned above.
-
Build an environement with an isolated Flexget that only allows to use the socks5 proxy for internet access. I used a docker environement where I put a flexget container and socks5 proxy on an isolated network and in addition i put the socks5 proxy on the bridge network.
Config:
web_server: yes
templates:
global:
pathscrub: windows
proxy: socks5://proxy:9150
tasks:
Manual:
proxy: socks5://proxy:9150
rss: "https://example.com/rss-feed"
thetvdb_lookup: yes
if:
- tvdb_ep_id == None: fail
retry_failed:
retry_time: 30 minutes
retry_time_multiplier: 2
max_retries: 10
set:
content_filename: "{{tvdb_series_name}} - {{tvdb_ep_id}}/{{tvdb_series_name}} - {{tvdb_ep_id}} - {{tvdb_ep_name|default('Unknown')}} - {{quality|upper}}"
move_completed_path: /downloads/video/tv/{{tvdb_series_name}}/
series:
- lorum ipsum
quality:
- 1080p webdl h264
deluge:
host: deluge.torrent
username: localclient
password: password
path: /downloads/downloading/
Log:
(click to expand)
[/tasks/Manual/proxy] u'socks5h://proxy:9150' is not a u'url'
Unable to download the RSS for task Manual (https://example.com/rss-feed): SOCKSHTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /rss-feed (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x7f84c54360d0>: Failed to establish a new connection: [Errno -3] Try again',))
Additional information:
- FlexGet version: 2.20.18
- Python version: 2.7.14
- urllib3: 1.24.1
- Installation method: https://hub.docker.com/r/cpoppema/docker-flexget/
- Using daemon (yes/no): yes