1CURLOPT_PROXYUSERPWD(3) curl_easy_setopt options CURLOPT_PROXYUSERPWD(3)
2
3
4
6 CURLOPT_PROXYUSERPWD - user name and password to use for proxy authen‐
7 tication
8
10 #include <curl/curl.h>
11
12 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERPWD, char
13 *userpwd);
14
16 Pass a char * as parameter, which should be [user name]:[password] to
17 use for the connection to the HTTP proxy. Both the name and the pass‐
18 word will be URL decoded before use, so to include for example a colon
19 in the user name you should encode it as %3A. (This is different to how
20 CURLOPT_USERPWD(3) is used - beware.)
21
22 Use CURLOPT_PROXYAUTH(3) to specify the authentication method.
23
24 The application does not have to keep the string around after setting
25 this option.
26
28 This is NULL by default.
29
31 Used with all protocols that can use a proxy
32
34 CURL *curl = curl_easy_init();
35 if(curl) {
36 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
37 curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
38 curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "clark%20kent:superman");
39 ret = curl_easy_perform(curl);
40 curl_easy_cleanup(curl);
41 }
42
44 Always
45
47 Returns CURLE_OK if proxies are supported, CURLE_UNKNOWN_OPTION if not,
48 or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
49
51 CURLOPT_PROXY(3), CURLOPT_PROXYTYPE(3),
52
53
54
55libcurl 7.61.1 May 30, 2017 CURLOPT_PROXYUSERPWD(3)