1CURLOPT_PROXYUSERNAME(3) curl_easy_setopt options CURLOPT_PROXYUSERNAME(3)
2
3
4
6 CURLOPT_PROXYUSERNAME - user name to use for proxy authentication
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERNAME,
12 char *username);
13
15 Pass a char * as parameter, which should be pointing to the null-termi‐
16 nated user name to use for the transfer.
17
18 CURLOPT_PROXYUSERNAME(3) sets the user name to be used in protocol au‐
19 thentication with the proxy.
20
21 To specify the proxy password use the CURLOPT_PROXYPASSWORD(3).
22
23 The application does not have to keep the string around after setting
24 this option.
25
27 blank
28
30 Most
31
33 CURL *curl = curl_easy_init();
34 if(curl) {
35 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
36 curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
37 curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith");
38 curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
39 ret = curl_easy_perform(curl);
40 curl_easy_cleanup(curl);
41 }
42
44 Added in 7.19.1
45
47 Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if
48 not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
49
51 CURLOPT_PROXYPASSWORD(3), CURLOPT_USERNAME(3), CURLOPT_HTTPAUTH(3),
52 CURLOPT_PROXYAUTH(3)
53
54
55
56libcurl 8.0.1 January 02, 2023 CURLOPT_PROXYUSERNAME(3)