1CURLOPT_IPRESOLVE(3) curl_easy_setopt options CURLOPT_IPRESOLVE(3)
2
3
4
6 CURLOPT_IPRESOLVE - IP protocol version to use
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_IPRESOLVE, long re‐
12 solve);
13
15 Allows an application to select what kind of IP addresses to use when
16 establishing a connection or choosing one from the connection pool.
17 This is interesting when using host names that resolve addresses using
18 more than one version of IP. The allowed values are:
19
20 CURL_IPRESOLVE_WHATEVER
21 Default, can use addresses of all IP versions that your system
22 allows.
23
24 CURL_IPRESOLVE_V4
25 Uses only IPv4 addresses.
26
27 CURL_IPRESOLVE_V6
28 Uses only IPv6 addresses.
29
31 CURL_IPRESOLVE_WHATEVER
32
34 All
35
37 CURL *curl = curl_easy_init();
38 if(curl) {
39 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
40
41 /* of all addresses example.com resolves to, only IPv6 ones are used */
42 curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
43
44 ret = curl_easy_perform(curl);
45
46 curl_easy_cleanup(curl);
47 }
48
49
51 Always
52
54 Returns CURLE_OK
55
57 CURLOPT_HTTP_VERSION(3), CURLOPT_SSLVERSION(3),
58
59
60
61libcurl 7.79.1 September 08, 2021 CURLOPT_IPRESOLVE(3)