CURLOPT_PROXYUSERNAME.3 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXYUSERNAME.md
  2. .TH CURLOPT_PROXYUSERNAME 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXYUSERNAME \- username to use for proxy authentication
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERNAME,
  9. char *username);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a char pointer as parameter, which should be pointing to the
  13. null\-terminated username to use for the transfer.
  14. \fICURLOPT_PROXYUSERNAME(3)\fP sets the username to be used in protocol
  15. authentication with the proxy.
  16. To specify the proxy password use the \fICURLOPT_PROXYPASSWORD(3)\fP.
  17. The application does not have to keep the string around after setting this
  18. option.
  19. .SH DEFAULT
  20. blank
  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_PROXYUSERNAME, "mrsmith");
  33. curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
  34. res = curl_easy_perform(curl);
  35. curl_easy_cleanup(curl);
  36. }
  37. }
  38. .fi
  39. .SH AVAILABILITY
  40. Added in curl 7.19.1
  41. .SH RETURN VALUE
  42. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  43. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  44. .SH SEE ALSO
  45. .BR CURLOPT_HTTPAUTH (3),
  46. .BR CURLOPT_PROXYAUTH (3),
  47. .BR CURLOPT_PROXYPASSWORD (3),
  48. .BR CURLOPT_USERNAME (3)