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

NAME

6       CURLOPT_SOCKS5_AUTH - methods for SOCKS5 proxy authentication
7

SYNOPSIS

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

DESCRIPTION

15       Pass a long as parameter, which is set to a bitmask,  to  tell  libcurl
16       which authentication method(s) are allowed for SOCKS5 proxy authentica‐
17       tion.  The only supported flags are CURLAUTH_BASIC, which allows  user‐
18       name/password authentication, CURLAUTH_GSSAPI, which allows GSS-API au‐
19       thentication, and CURLAUTH_NONE, which allows no  authentication.   Set
20       the  actual user name and password with the CURLOPT_PROXYUSERPWD(3) op‐
21       tion.
22

DEFAULT

24       CURLAUTH_BASIC|CURLAUTH_GSSAPI
25

PROTOCOLS

27       All
28

EXAMPLE

30       CURL *curl = curl_easy_init();
31       if(curl) {
32         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
33
34         /* request to use a SOCKS5 proxy */
35         curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://user:pass@myproxy.com");
36
37         /* enable username/password authentication only */
38         curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, CURLAUTH_BASIC);
39
40         /* Perform the request */
41         curl_easy_perform(curl);
42       }
43

AVAILABILITY

45       Added in 7.55.0
46

RETURN VALUE

48       Returns CURLE_OK if the option is  supported,  CURLE_UNKNOWN_OPTION  if
49       not, or CURLE_NOT_BUILT_IN if the bitmask contains unsupported flags.
50

SEE ALSO

52       CURLOPT_PROXY(3), CURLOPT_PROXYTYPE(3)
53
54
55
56libcurl 7.79.1                September 08, 2021        CURLOPT_SOCKS5_AUTH(3)
Impressum