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.
Just rechecked against the RFC.  Regarding the length, you're right, of course.

My only concern that I tried to address with my above suggestion is that it could depend on the SOCKS server implementation whether passing an IP address together with a domain name address type will work or not.