CURLOPT_PROXYUSERPWD.3 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXYUSERPWD.md
  2. .TH CURLOPT_PROXYUSERPWD 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXYUSERPWD \- username and password to use for proxy authentication
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERPWD, char *userpwd);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a char pointer as parameter, which should be [username]:[password] to use
  12. for the connection to the HTTP proxy. Both the name and the password are URL
  13. decoded before used, so to include for example a colon in the username you
  14. should encode it as %3A. (This is different to how \fICURLOPT_USERPWD(3)\fP is
  15. used \- beware.)
  16. Use \fICURLOPT_PROXYAUTH(3)\fP to specify the authentication method.
  17. The application does not have to keep the string around after setting this
  18. option.
  19. .SH DEFAULT
  20. NULL
  21. .SH PROTOCOLS
  22. This functionality affects all supported protocols
  23. .SH EXAMPLE
  24. .nf
  25. int main(void)
  26. {
  27. CURL *curl = curl_easy_init();
  28. if(curl) {
  29. CURLcode res;
  30. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
  31. curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
  32. curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "clark%20kent:superman");
  33. res = curl_easy_perform(curl);
  34. curl_easy_cleanup(curl);
  35. }
  36. }
  37. .fi
  38. .SH AVAILABILITY
  39. Added in curl 7.1
  40. .SH RETURN VALUE
  41. Returns CURLE_OK if proxies are supported, CURLE_UNKNOWN_OPTION if not, or
  42. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  43. .SH SEE ALSO
  44. .BR CURLOPT_PROXY (3),
  45. .BR CURLOPT_PROXYPASSWORD (3),
  46. .BR CURLOPT_PROXYTYPE (3),
  47. .BR CURLOPT_PROXYUSERNAME (3)