1CURLOPT_IPRESOLVE(3)       curl_easy_setopt options       CURLOPT_IPRESOLVE(3)
2
3
4

NAME

6       CURLOPT_IPRESOLVE - IP protocol version to use
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_IPRESOLVE, long resolve);
12

DESCRIPTION

14       Allows  an  application to select what kind of IP addresses to use when
15       establishing a connection or choosing one  from  the  connection  pool.
16       This  is interesting when using host names that resolve addresses using
17       more than one version of IP. The allowed values are:
18
19       CURL_IPRESOLVE_WHATEVER
20              Default, can use addresses of all IP versions that  your  system
21              allows.
22
23       CURL_IPRESOLVE_V4
24              Uses only IPv4 addresses.
25
26       CURL_IPRESOLVE_V6
27              Uses only IPv6 addresses.
28

DEFAULT

30       CURL_IPRESOLVE_WHATEVER
31

PROTOCOLS

33       All
34

EXAMPLE

36       CURL *curl = curl_easy_init();
37       if(curl) {
38         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
39
40         /* of all addresses example.com resolves to, only IPv6 ones are used */
41         curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
42
43         ret = curl_easy_perform(curl);
44
45         curl_easy_cleanup(curl);
46       }
47
48

AVAILABILITY

50       Always
51

RETURN VALUE

53       Returns CURLE_OK
54

SEE ALSO

56       CURLOPT_HTTP_VERSION(3), CURLOPT_SSLVERSION(3),
57
58
59
60libcurl 7.85.0                   May 17, 2022             CURLOPT_IPRESOLVE(3)
Impressum