如何连接到expressVPN?

时间:2019-04-17 12:32:23

标签: c winapi proxy winhttp

这是我到目前为止尝试过的:

  1. 使用WINHTTP_OPTION_PROXY_PASSWORD和WINHTTP_OPTION_PROXY_PASSWORD

  2. 使用WinHttpSetCredentials

  3. 使用纯文本,例如L“ https://username:password@norway-ubuntu-l2tp.expressprovider.com

这是我的完整代码,带有最新的尝试:

fetch(WCHAR uri_sprintf[])
{ 
    extern DWORD dwReadBytes, chBuffer;
    HINTERNET hB1, hB0, hB2;
    WinHttpSendRequest(hB2=WinHttpOpenRequest(hB1=WinHttpConnect(hB0=WinHttpOpen
        (L"",WINHTTP_ACCESS_TYPE_NAMED_PROXY,L"https://username:password@norway-ubuntu-l2tp.expressprovider.com",
            WINHTTP_NO_PROXY_BYPASS,0),L"www.google.com",INTERNET_DEFAULT_HTTPS_PORT,0),
        NULL,uri_sprintf,NULL,WINHTTP_NO_REFERER,WINHTTP_DEFAULT_ACCEPT_TYPES,WINHTTP_FLAG_SECURE),
        WINHTTP_NO_ADDITIONAL_HEADERS,0,WINHTTP_NO_REQUEST_DATA,0,0,0),

        WinHttpReceiveResponse(hB2,NULL),

        WinHttpQueryDataAvailable(hB2,&dwReadBytes),

        WinHttpReadData(hB2,&chBuffer,dwReadBytes,&dwReadBytes),

        WinHttpCloseHandle(hB2),

    WinHttpCloseHandle(hB1), WinHttpCloseHandle(hB0);
} 

0 个答案:

没有答案