1CURLOPT_SOCKS5_AUTH(3) curl_easy_setopt options CURLOPT_SOCKS5_AUTH(3)
2
3
4
6 CURLOPT_SOCKS5_AUTH - set allowed methods for SOCKS5 proxy authentica‐
7 tion
8
10 #include <curl/curl.h>
11
12 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SOCKS5_AUTH, long bit‐
13 mask);
14
16 Pass a long as parameter, which is set to a bitmask, to tell libcurl
17 which authentication method(s) are allowed for SOCKS5 proxy authentica‐
18 tion. The only supported flags are CURLAUTH_BASIC, which allows user‐
19 name/password authentication, CURLAUTH_GSSAPI, which allows GSS-API
20 authentication, and CURLAUTH_NONE, which allows no authentication. Set
21 the actual user name and password with the CURLOPT_PROXYUSERPWD(3)
22 option.
23
25 CURLAUTH_BASIC|CURLAUTH_GSSAPI
26
28 All
29
31 CURL *curl = curl_easy_init();
32 if(curl) {
33 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
34
35 /* request to use a SOCKS5 proxy */
36 curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://user:pass@myproxy.com");
37
38 /* enable username/password authentication only */
39 curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, CURLAUTH_BASIC);
40
41 /* Perform the request */
42 curl_easy_perform(curl);
43 }
44
46 Added in 7.55.0
47
49 Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if
50 not, or CURLE_NOT_BUILT_IN if the bitmask contains unsupported flags.
51
53 CURLOPT_PROXY(3), CURLOPT_PROXYTYPE(3)
54
55
56
57libcurl 7.69.1 April 27, 2017 CURLOPT_SOCKS5_AUTH(3)