How can I securely connect to the SOCKS5 proxy server, there is a code to connect normal http proxy servers:

proxyUrl, err := url.Parse(proxyS) httpClient := &http.Client{ Transport: &http.Transport{Proxy: http.ProxyURL(proxyUrl)}, } 

For SOCKS5 code examples are not found.

    1 answer 1

    As written in the documentation :

     // The proxy type is determined by the URL scheme. "http" // and "socks5" are supported. If the scheme is empty, // "http" is assumed. 

    So your proxyURL should be like

     socks5://1.2.3.4:1080