As a git user, which has recently started using git-lfs, which in turn is written in go, I've stumbled across the same issue.
Sometimes i need to use git with a socks5h HTTPS_PROXY, and git works just fine, but git-ls gives the above error message saying host socks5h cannot be resolved. When I set HTTPS_PROXY to using socks5 instead, git-ls works, but now git tries to resolve all host names and give the resulting IPs to the socks server, which does not work with my setup and is one of the reasons I'm using the socks server in the first place.
The only way around this is using a combination of HTTPS_PROXY=socks5://server:port and https_proxy=socks5h://server:port, which works because git-lfs gives HTTPS_PROXY precedence over https_proxy, while git itself does exactly the opposite.
Given that the socks5 implemented in go is in reality socks5h in the first place, why not add socks5h to the list of proxy protocols recognized and just handle it the same as socks5? The above mentioned change https://go-review.googlesource.com/c/net/+/156518 seems to try exactly this, even though I don't quite understand, why it split off part of the change into another change at https://go-review.googlesource.com/c/go/+/162318 .
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
What did you expect to see?
What did you see instead?
go getdoes not understand
HTTPS_PROXY, even though it understands
For example, to test using the tor proxy:
Other tools that understand
socks5h(resolve hostname through the proxy, not locally). curl and yum, for example.
Related to issue #18508.
The text was updated successfully, but these errors were encountered: