Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for socks5h:// proxies #22618

Open
yurendry opened this issue Oct 5, 2019 · 0 comments
Open

Support for socks5h:// proxies #22618

yurendry opened this issue Oct 5, 2019 · 0 comments
Labels

Comments

@yurendry
Copy link

@yurendry yurendry commented Oct 5, 2019

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2019.09.28
  • I've searched the bugtracker for similar feature requests including closed ones

Description

The difference between SOCKS5 and SOCKS5H is that SOCKS5H resolves DNS requests through the proxy and SOCKS5 resolves them locally. The DNS leak has technically been addressed in #9677 and it appears to been removed based on tests I carried out sniffing for DNS packets while running youtube-dl with --proxy socks5:// (this is the relevant line, I think).

So youtube-dl --proxy socks5:// behaves how youtube-dl --proxy socks5h:// should behave, and the latter misbehaves:

youtube-dl --proxy socks5h://127.0.0.1:9050 https://www.youtube.com/watch?v=BaW_jenozKc
[youtube] BaW_jenozKc: Downloading webpage
ERROR: Unable to download webpage: <urlopen error Tunnel connection failed: 501 Tor is not an HTTP Proxy> (caused by URLError(error('Tunnel connection failed: 501 Tor is not an HTTP Proxy',),))

I suggest that youtube-dl should accept the socks5h protocol and use for it the implementation of SOCKS5 that already exists (where DNS is resolved by the SOCKS server).

And maybe socks5's implementation should be changed to resolve DNS locally to honour the specification. The only issue I can see with fixing the names of the protocols is any scripts with socks5:// in them will start leaking DNS requests.

@yurendry yurendry added the request label Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.