1CURLINFO_PROXY_ERROR(3)    curl_easy_getinfo options   CURLINFO_PROXY_ERROR(3)
2
3
4

NAME

6       CURLINFO_PROXY_ERROR - get the detailed (SOCKS) proxy error
7

SYNOPSIS

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

DESCRIPTION

52       Pass a pointer to a long to receive a detailed error code when the most
53       recent transfer returned a CURLE_PROXY error.
54
55       The return value will match the CURLproxycode set.
56
57       The returned value will be zero (equal to CURLPX_OK)  if  no  such  re‐
58       sponse code was available.
59

PROTOCOLS

61       All that can be done over SOCKS
62

EXAMPLE

64       CURL *curl = curl_easy_init();
65       if(curl) {
66         CURLcode res;
67         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
68
69         curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://127.0.0.1");
70         res = curl_easy_perform(curl);
71         if(res == CURLE_PROXY) {
72           long proxycode;
73           res = curl_easy_getinfo(curl, CURLINFO_PROXY_ERROR, &proxycode);
74           if(!res && proxycode)
75             printf("The detailed proxy error: %ld\n", proxycode);
76         }
77         curl_easy_cleanup(curl);
78       }
79

AVAILABILITY

81       Added in 7.73.0
82

RETURN VALUE

84       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
85       if not.
86

SEE ALSO

88       CURLINFO_RESPONSE_CODE(3),   libcurl-errors(3),   curl_easy_getinfo(3),
89       curl_easy_setopt(3),
90
91
92
93libcurl 7.79.1                 November 04, 2020       CURLINFO_PROXY_ERROR(3)
Impressum