SOCKS proxy environment variable ignored by command line applications

Solution 1:

If you're passing --sox5-hostname, then the equivalent in environment variables is "socks5h://", per the man page for curl(1):

PROXY PROTOCOL PREFIXES
       Since curl version 7.21.7, the proxy string may be specified with a  protocol://  prefix  to  specify
       alternative proxy protocols.

       If  no  protocol is specified in the proxy string or if the string doesn't match a supported one, the
       proxy will be treated as an HTTP proxy.

       The supported proxy protocol prefixes are as follows:

       socks4://
              Makes it the equivalent of --socks4

       socks4a://
              Makes it the equivalent of --socks4a

       socks5://
              Makes it the equivalent of --socks5

       socks5h://
              Makes it the equivalent of --socks5-hostname