Is socks5 proxy supported in winlnet lib ?

Jidcoo 111 Reputation points
2021-09-27T14:48:02.98+00:00
/**
 * result format:
 * HTTP://proxyserver:port
 * HTTPS://proxyserver:port
 * SOCKS=proxyserver:port
 */
const string Proxy::toString()
{
    string NULL_FLAG("NULL");
    if(this->getHostName().compare(NULL_FLAG)==0){
        return "";
    }
    string str;
    string port_str = to_string(port);
    switch (getProtocol()){
    case HTTP:
        str = "HTTP://";
        break;
    case HTTPS:
        str = "HTTPS://";
        break;
    case SOCKS4:
        str = "SOCKS=";
        break;
    case SOCKS5:
        // i don't know how to do in this case?
        // may be not supported in winlnet ?
        //str = "SOCKS5=";
        break;
    default:
        str = "HTTP://";
        break;
    }
    str += (hostName + ":");
    str += port_str;
    return str;
}

The return value of this function will be the second parameter (lpszproxy) in the InternetOpen function.

And this function works normally in HTTP, HTTPS and SOCKS4 protocols. But I don't know how to do in SOCKS5 protocol.

So, is SOCKS5 proxy supported in winlnet lib ?
If yes,how can i do in the SOCKS5 case

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,685 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xiaopo Yang - MSFT 12,726 Reputation points Microsoft Vendor
    2021-09-28T05:28:39.13+00:00

    According to the thread, Socks5 proxy is not supported.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.