CURLINFO_PROXY_ERROR.3 3.3 KB

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