CURLINFO_PROXY_ERROR.3 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2020, 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 CURLINFO_PROXY_ERROR 3 "3 Aug 2020" "libcurl 7.73.0" "curl_easy_getinfo options"
  24. .SH NAME
  25. CURLINFO_PROXY_ERROR \- get the detailed (SOCKS) proxy error
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. typedef enum {
  30. CURLPX_OK,
  31. CURLPX_BAD_ADDRESS_TYPE,
  32. CURLPX_BAD_VERSION,
  33. CURLPX_CLOSED,
  34. CURLPX_GSSAPI,
  35. CURLPX_GSSAPI_PERMSG,
  36. CURLPX_GSSAPI_PROTECTION,
  37. CURLPX_IDENTD,
  38. CURLPX_IDENTD_DIFFER,
  39. CURLPX_LONG_HOSTNAME,
  40. CURLPX_LONG_PASSWD,
  41. CURLPX_LONG_USER,
  42. CURLPX_NO_AUTH,
  43. CURLPX_RECV_ADDRESS,
  44. CURLPX_RECV_AUTH,
  45. CURLPX_RECV_CONNECT,
  46. CURLPX_RECV_REQACK,
  47. CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
  48. CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
  49. CURLPX_REPLY_CONNECTION_REFUSED,
  50. CURLPX_REPLY_GENERAL_SERVER_FAILURE,
  51. CURLPX_REPLY_HOST_UNREACHABLE,
  52. CURLPX_REPLY_NETWORK_UNREACHABLE,
  53. CURLPX_REPLY_NOT_ALLOWED,
  54. CURLPX_REPLY_TTL_EXPIRED,
  55. CURLPX_REPLY_UNASSIGNED,
  56. CURLPX_REQUEST_FAILED,
  57. CURLPX_RESOLVE_HOST,
  58. CURLPX_SEND_AUTH,
  59. CURLPX_SEND_CONNECT,
  60. CURLPX_SEND_REQUEST,
  61. CURLPX_UNKNOWN_FAIL,
  62. CURLPX_UNKNOWN_MODE,
  63. CURLPX_USER_REJECTED,
  64. CURLPX_LAST /* never use */
  65. } CURLproxycode;
  66. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXY_ERROR, long *detail);
  67. .fi
  68. .SH DESCRIPTION
  69. Pass a pointer to a long to receive a detailed error code when the most recent
  70. transfer returned a CURLE_PROXY error.
  71. The return value will match the CURLproxycode set.
  72. The returned value will be zero (equal to CURLPX_OK) if no such response code
  73. was available.
  74. .SH PROTOCOLS
  75. All that can be done over SOCKS
  76. .SH EXAMPLE
  77. .nf
  78. CURL *curl = curl_easy_init();
  79. if(curl) {
  80. CURLcode res;
  81. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  82. curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://127.0.0.1");
  83. res = curl_easy_perform(curl);
  84. if(res == CURLE_PROXY) {
  85. long proxycode;
  86. res = curl_easy_getinfo(curl, CURLINFO_PROXY_ERROR, &proxycode);
  87. if(!res && proxycode)
  88. printf("The detailed proxy error: %ld\\n", proxycode);
  89. }
  90. curl_easy_cleanup(curl);
  91. }
  92. .fi
  93. .SH AVAILABILITY
  94. Added in 7.73.0
  95. .SH RETURN VALUE
  96. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  97. .SH "SEE ALSO"
  98. .BR CURLINFO_RESPONSE_CODE "(3), " libcurl-errors "(3), "
  99. .BR curl_easy_getinfo "(3), " curl_easy_setopt "(3), "