1CURLINFO_PROXY_ERROR(3) libcurl CURLINFO_PROXY_ERROR(3)
2
3
4
6 CURLINFO_PROXY_ERROR - get the detailed (SOCKS) proxy error
7
9 #include <curl/curl.h>
10
11 typedef enum {
12 CURLPX_OK,
13 CURLPX_BAD_ADDRESS_TYPE,
14 CURLPX_BAD_VERSION,
15 CURLPX_CLOSED,
16 CURLPX_GSSAPI,
17 CURLPX_GSSAPI_PERMSG,
18 CURLPX_GSSAPI_PROTECTION,
19 CURLPX_IDENTD,
20 CURLPX_IDENTD_DIFFER,
21 CURLPX_LONG_HOSTNAME,
22 CURLPX_LONG_PASSWD,
23 CURLPX_LONG_USER,
24 CURLPX_NO_AUTH,
25 CURLPX_RECV_ADDRESS,
26 CURLPX_RECV_AUTH,
27 CURLPX_RECV_CONNECT,
28 CURLPX_RECV_REQACK,
29 CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
30 CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
31 CURLPX_REPLY_CONNECTION_REFUSED,
32 CURLPX_REPLY_GENERAL_SERVER_FAILURE,
33 CURLPX_REPLY_HOST_UNREACHABLE,
34 CURLPX_REPLY_NETWORK_UNREACHABLE,
35 CURLPX_REPLY_NOT_ALLOWED,
36 CURLPX_REPLY_TTL_EXPIRED,
37 CURLPX_REPLY_UNASSIGNED,
38 CURLPX_REQUEST_FAILED,
39 CURLPX_RESOLVE_HOST,
40 CURLPX_SEND_AUTH,
41 CURLPX_SEND_CONNECT,
42 CURLPX_SEND_REQUEST,
43 CURLPX_UNKNOWN_FAIL,
44 CURLPX_UNKNOWN_MODE,
45 CURLPX_USER_REJECTED,
46 CURLPX_LAST /* never use */
47 } CURLproxycode;
48
49 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXY_ERROR, long *detail);
50
52 Pass a pointer to a long to receive a detailed error code when the most
53 recent transfer returned a CURLE_PROXY error. That error code will
54 match the CURLproxycode set.
55
56 The error code will be zero (CURLPX_OK) if no response code was availā
57 able.
58
60 All that can be done over SOCKS
61
63 CURL *curl = curl_easy_init();
64 if(curl) {
65 CURLcode res;
66 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
67
68 curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://127.0.0.1");
69 res = curl_easy_perform(curl);
70 if(res == CURLE_PROXY) {
71 long proxycode;
72 res = curl_easy_getinfo(curl, CURLINFO_PROXY_ERROR, &proxycode);
73 if(!res && proxycode)
74 printf("The detailed proxy error: %ld\n", proxycode);
75 }
76 curl_easy_cleanup(curl);
77 }
78
80 Added in 7.73.0
81
83 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
84 if not.
85
87 CURLINFO_RESPONSE_CODE(3), libcurl-errors(3), curl_easy_getinfo(3),
88 curl_easy_setopt(3),
89
90
91
92ibcurl 8.2.1 April 26, 2023 CURLINFO_PROXY_ERROR(3)