1CURLOPT_PROXYAUTH(3)       curl_easy_setopt options       CURLOPT_PROXYAUTH(3)
2
3
4

NAME

6       CURLOPT_PROXYAUTH - set HTTP proxy authentication methods to try
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle,  CURLOPT_PROXYAUTH, long bit‐
12       mask);
13

DESCRIPTION

15       Pass a long as parameter, which is set to a bitmask,  to  tell  libcurl
16       which  HTTP  authentication method(s) you want it to use for your proxy
17       authentication.  If more than one bit is set, libcurl will first  query
18       the  site  to see what authentication methods it supports and then pick
19       the best one you allow it to use. For some methods, this will induce an
20       extra  network  round-trip.  Set  the actual name and password with the
21       CURLOPT_PROXYUSERPWD(3) option.
22
23       The bitmask can be constructed by or'ing together the bits fully listed
24       and described in the CURLOPT_HTTPAUTH(3) man page.
25

DEFAULT

27       CURLAUTH_BASIC
28

PROTOCOLS

30       HTTP
31

EXAMPLE

33       CURL *curl = curl_easy_init();
34       if(curl) {
35         CURLcode ret;
36         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
37         /* use this proxy */
38         curl_easy_setopt(curl, CURLOPT_PROXY, "http://local.example.com:1080");
39         /* allow whatever auth the proxy speaks */
40         curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
41         /* set the proxy credentials */
42         curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "james:007");
43         ret = curl_easy_perform(curl);
44         curl_easy_cleanup(curl);
45       }
46

AVAILABILITY

48       Added in 7.10.7
49

RETURN VALUE

51       Returns  CURLE_OK  if  the option is supported, CURLE_UNKNOWN_OPTION if
52       not, or  CURLE_NOT_BUILT_IN  if  the  bitmask  specified  no  supported
53       authentication methods.
54

SEE ALSO

56       CURLOPT_PROXY(3),  CURLOPT_PROXYTYPE(3),  CURLOPT_PROXYUSERPWD(3), CUR‐
57       LOPT_PROXYPORT(3),
58
59
60
61libcurl 7.66.0                   May 30, 2017             CURLOPT_PROXYAUTH(3)
Impressum