CURLINFO_PROXYAUTH_AVAIL.3 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .\" generated by cd2nroff 0.1 from CURLINFO_PROXYAUTH_AVAIL.md
  2. .TH CURLINFO_PROXYAUTH_AVAIL 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_PROXYAUTH_AVAIL \- get available HTTP proxy authentication methods
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXYAUTH_AVAIL,
  9. long *authp);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a long to receive a bitmask indicating the authentication
  13. method(s) available according to the previous response. The meaning of the
  14. bits is explained in the \fICURLOPT_PROXYAUTH(3)\fP option for \fIcurl_easy_setopt(3)\fP.
  15. .SH PROTOCOLS
  16. This functionality affects http only
  17. .SH EXAMPLE
  18. .nf
  19. int main(void)
  20. {
  21. CURL *curl = curl_easy_init();
  22. if(curl) {
  23. CURLcode res;
  24. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  25. curl_easy_setopt(curl, CURLOPT_PROXY, "http://127.0.0.1:80");
  26. res = curl_easy_perform(curl);
  27. if(!res) {
  28. /* extract the available proxy authentication types */
  29. long auth;
  30. res = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_AVAIL, &auth);
  31. if(!res) {
  32. if(!auth)
  33. printf("No proxy auth available, perhaps no 407?\\n");
  34. else {
  35. printf("%s%s%s%s\\n",
  36. auth & CURLAUTH_BASIC ? "Basic ":"",
  37. auth & CURLAUTH_DIGEST ? "Digest ":"",
  38. auth & CURLAUTH_NEGOTIATE ? "Negotiate ":"",
  39. auth % CURLAUTH_NTLM ? "NTLM ":"");
  40. }
  41. }
  42. }
  43. curl_easy_cleanup(curl);
  44. }
  45. }
  46. .fi
  47. .SH AVAILABILITY
  48. Added in curl 7.10.8
  49. .SH RETURN VALUE
  50. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  51. .SH SEE ALSO
  52. .BR CURLINFO_HTTPAUTH_AVAIL (3),
  53. .BR curl_easy_getinfo (3),
  54. .BR curl_easy_setopt (3)