CURLINFO_PROXY_ERROR.3 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .\" generated by cd2nroff 0.1 from CURLINFO_PROXY_ERROR.md
  2. .TH CURLINFO_PROXY_ERROR 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_PROXY_ERROR \- get the detailed (SOCKS) proxy error
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. typedef enum {
  9. CURLPX_OK,
  10. CURLPX_BAD_ADDRESS_TYPE,
  11. CURLPX_BAD_VERSION,
  12. CURLPX_CLOSED,
  13. CURLPX_GSSAPI,
  14. CURLPX_GSSAPI_PERMSG,
  15. CURLPX_GSSAPI_PROTECTION,
  16. CURLPX_IDENTD,
  17. CURLPX_IDENTD_DIFFER,
  18. CURLPX_LONG_HOSTNAME,
  19. CURLPX_LONG_PASSWD,
  20. CURLPX_LONG_USER,
  21. CURLPX_NO_AUTH,
  22. CURLPX_RECV_ADDRESS,
  23. CURLPX_RECV_AUTH,
  24. CURLPX_RECV_CONNECT,
  25. CURLPX_RECV_REQACK,
  26. CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
  27. CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
  28. CURLPX_REPLY_CONNECTION_REFUSED,
  29. CURLPX_REPLY_GENERAL_SERVER_FAILURE,
  30. CURLPX_REPLY_HOST_UNREACHABLE,
  31. CURLPX_REPLY_NETWORK_UNREACHABLE,
  32. CURLPX_REPLY_NOT_ALLOWED,
  33. CURLPX_REPLY_TTL_EXPIRED,
  34. CURLPX_REPLY_UNASSIGNED,
  35. CURLPX_REQUEST_FAILED,
  36. CURLPX_RESOLVE_HOST,
  37. CURLPX_SEND_AUTH,
  38. CURLPX_SEND_CONNECT,
  39. CURLPX_SEND_REQUEST,
  40. CURLPX_UNKNOWN_FAIL,
  41. CURLPX_UNKNOWN_MODE,
  42. CURLPX_USER_REJECTED,
  43. CURLPX_LAST /* never use */
  44. } CURLproxycode;
  45. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXY_ERROR, long *detail);
  46. .fi
  47. .SH DESCRIPTION
  48. Pass a pointer to a long to receive a detailed error code when the most recent
  49. transfer returned a \fBCURLE_PROXY\fP error. That error code matches the
  50. \fBCURLproxycode\fP set.
  51. The error code is zero (\fBCURLPX_OK\fP) if no response code was available.
  52. .SH PROTOCOLS
  53. This functionality affects all supported protocols
  54. .SH EXAMPLE
  55. .nf
  56. int main(void)
  57. {
  58. CURL *curl = curl_easy_init();
  59. if(curl) {
  60. CURLcode res;
  61. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  62. curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://127.0.0.1");
  63. res = curl_easy_perform(curl);
  64. if(res == CURLE_PROXY) {
  65. long proxycode;
  66. res = curl_easy_getinfo(curl, CURLINFO_PROXY_ERROR, &proxycode);
  67. if(!res && proxycode)
  68. printf("The detailed proxy error: %ld\\n", proxycode);
  69. }
  70. curl_easy_cleanup(curl);
  71. }
  72. }
  73. .fi
  74. .SH AVAILABILITY
  75. Added in curl 7.73.0
  76. .SH RETURN VALUE
  77. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  78. .SH SEE ALSO
  79. .BR CURLINFO_RESPONSE_CODE (3),
  80. .BR curl_easy_getinfo (3),
  81. .BR curl_easy_setopt (3),
  82. .BR libcurl-errors (3)