Enhanced SOCKS5 Support

Enhanced SOCKS5 Support

Supports HTTP and HTTPS destinations and performs all hostname resolution via the SOCKS proxy, preventing privacy leakage if used with Tor.

Verified to work when the destination url uses an IP address instead of a hostname.
Yes, I also missed that `inet:parse_address/1` returns `ok` as first tuple element if the address can be parsed successfully.

Here's an improved version:

````erlang
connect(Host, Port, Via) when is_list(Host), is_integer(Port), is_port(Via) ->
    {AddressType, Address} = case inet:parse_address(Host) of
        {ok, {IP1, IP2, IP3, IP4}} ->
            {?ATYP_IPV4, <<IP1,IP2,IP3,IP4>>};
        {ok, {IP1, IP2, IP3, IP4, IP5, IP6, IP7, IP8}} ->
            {?ATYP_IPV6, <<IP1,IP2,IP3,IP4,IP5,IP6,IP7,IP8>>};
        _ ->
            HostBin = list_to_binary(Host),
            HostBinLength = byte_size(HostBin),
            {?ATYP_DOMAINNAME, <<HostBinLength,HostBin/binary>>}
    end,
    ok = gen_tcp:send(Via,
        <<?VERSION, ?CONNECT, ?RESERVED,
          AddressType, Address/binary,
          Port:16>>),
    case gen_tcp:recv(Via, 0) of
        {ok, <<?VERSION, ?SUCCEEDED, ?RESERVED, _/binary>>} -> ok;
        {ok, <<?VERSION, Rep, ?RESERVED, _/binary>>} -> {error, rep(Rep)};
        {error, Reason} -> {error, Reason}
    end.
````