CURLOPT_PROXYAUTH.3 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2017, 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. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_PROXYAUTH 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_PROXYAUTH \- set HTTP proxy authentication methods to try
  26. .SH SYNOPSIS
  27. #include <curl/curl.h>
  28. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYAUTH, long bitmask);
  29. .SH DESCRIPTION
  30. Pass a long as parameter, which is set to a bitmask, to tell libcurl which
  31. HTTP authentication method(s) you want it to use for your proxy
  32. authentication. If more than one bit is set, libcurl will first query the
  33. site to see what authentication methods it supports and then pick the best one
  34. you allow it to use. For some methods, this will induce an extra network
  35. round-trip. Set the actual name and password with the
  36. \fICURLOPT_PROXYUSERPWD(3)\fP option.
  37. The bitmask can be constructed by or'ing together the bits fully listed and
  38. described in the \fICURLOPT_HTTPAUTH(3)\fP man page.
  39. .SH DEFAULT
  40. CURLAUTH_BASIC
  41. .SH PROTOCOLS
  42. HTTP
  43. .SH EXAMPLE
  44. .nf
  45. CURL *curl = curl_easy_init();
  46. if(curl) {
  47. CURLcode ret;
  48. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  49. /* use this proxy */
  50. curl_easy_setopt(curl, CURLOPT_PROXY, "http://local.example.com:1080");
  51. /* allow whatever auth the proxy speaks */
  52. curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
  53. /* set the proxy credentials */
  54. curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "james:007");
  55. ret = curl_easy_perform(curl);
  56. curl_easy_cleanup(curl);
  57. }
  58. .fi
  59. .SH AVAILABILITY
  60. Added in 7.10.7
  61. .SH RETURN VALUE
  62. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  63. CURLE_NOT_BUILT_IN if the bitmask specified no supported authentication
  64. methods.
  65. .SH "SEE ALSO"
  66. .BR CURLOPT_PROXY "(3), " CURLOPT_PROXYTYPE "(3), "
  67. .BR CURLOPT_PROXYUSERPWD "(3), " CURLOPT_PROXYPORT "(3), "