CURLOPT_SOCKS5_AUTH.3 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. .\" generated by cd2nroff 0.1 from CURLOPT_SOCKS5_AUTH.md
  2. .TH CURLOPT_SOCKS5_AUTH 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_SOCKS5_AUTH \- methods for SOCKS5 proxy authentication
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SOCKS5_AUTH, long bitmask);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a long as parameter, which is set to a bitmask, to tell libcurl which
  12. authentication method(s) are allowed for SOCKS5 proxy authentication. The only
  13. supported flags are \fICURLAUTH_BASIC\fP, which allows username/password
  14. authentication, \fICURLAUTH_GSSAPI\fP, which allows GSS\-API authentication, and
  15. \fICURLAUTH_NONE\fP, which allows no authentication. Set the actual username and
  16. password with the \fICURLOPT_PROXYUSERPWD(3)\fP option.
  17. .SH DEFAULT
  18. CURLAUTH_BASIC|CURLAUTH_GSSAPI
  19. .SH PROTOCOLS
  20. This functionality affects all supported protocols
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. CURL *curl = curl_easy_init();
  26. if(curl) {
  27. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  28. /* request to use a SOCKS5 proxy */
  29. curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://user:pass@myproxy.com");
  30. /* enable username/password authentication only */
  31. curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, (long)CURLAUTH_BASIC);
  32. /* Perform the request */
  33. curl_easy_perform(curl);
  34. }
  35. }
  36. .fi
  37. .SH AVAILABILITY
  38. Added in curl 7.55.0
  39. .SH RETURN VALUE
  40. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  41. CURLE_NOT_BUILT_IN if the bitmask contains unsupported flags.
  42. .SH SEE ALSO
  43. .BR CURLOPT_PROXY (3),
  44. .BR CURLOPT_PROXYTYPE (3)