CURLOPT_PROXYAUTH.3 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_PROXYAUTH 3 "19 Jun 2014" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_PROXYAUTH \- HTTP proxy authentication methods
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYAUTH, long bitmask);
  32. .fi
  33. .SH DESCRIPTION
  34. Pass a long as parameter, which is set to a bitmask, to tell libcurl which
  35. HTTP authentication method(s) you want it to use for your proxy
  36. authentication. If more than one bit is set, libcurl will first query the
  37. site to see what authentication methods it supports and then pick the best one
  38. you allow it to use. For some methods, this will induce an extra network
  39. round-trip. Set the actual name and password with the
  40. \fICURLOPT_PROXYUSERPWD(3)\fP option.
  41. The bitmask can be constructed by the bits listed and described in the
  42. \fICURLOPT_HTTPAUTH(3)\fP man page.
  43. .SH DEFAULT
  44. CURLAUTH_BASIC
  45. .SH PROTOCOLS
  46. HTTP
  47. .SH EXAMPLE
  48. .nf
  49. CURL *curl = curl_easy_init();
  50. if(curl) {
  51. CURLcode ret;
  52. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  53. /* use this proxy */
  54. curl_easy_setopt(curl, CURLOPT_PROXY, "http://local.example.com:1080");
  55. /* allow whatever auth the proxy speaks */
  56. curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
  57. /* set the proxy credentials */
  58. curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "james:007");
  59. ret = curl_easy_perform(curl);
  60. curl_easy_cleanup(curl);
  61. }
  62. .fi
  63. .SH AVAILABILITY
  64. Added in 7.10.7
  65. .SH RETURN VALUE
  66. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  67. CURLE_NOT_BUILT_IN if the bitmask specified no supported authentication
  68. methods.
  69. .SH "SEE ALSO"
  70. .BR CURLOPT_PROXY "(3), " CURLOPT_PROXYTYPE "(3), "
  71. .BR CURLOPT_PROXYUSERPWD "(3), " CURLOPT_PROXYPORT "(3), "