1CURLOPT_IPRESOLVE(3)                libcurl               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 to more than one
17       version of IP.
18
19       If the URL provided for a transfer contains a numerical IP version as a
20       host name, this option will not override or prohibit libcurl from using
21       that IP version.
22
23       Available values for this option are:
24
25       CURL_IPRESOLVE_WHATEVER
26              Default, can use addresses of all IP versions that  your  system
27              allows.
28
29       CURL_IPRESOLVE_V4
30              Uses only IPv4 addresses.
31
32       CURL_IPRESOLVE_V6
33              Uses only IPv6 addresses.
34

DEFAULT

36       CURL_IPRESOLVE_WHATEVER
37

PROTOCOLS

39       All
40

EXAMPLE

42       CURL *curl = curl_easy_init();
43       if(curl) {
44         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
45
46         /* of all addresses example.com resolves to, only IPv6 ones are used */
47         curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
48
49         ret = curl_easy_perform(curl);
50
51         curl_easy_cleanup(curl);
52       }
53
54

AVAILABILITY

56       Always
57

RETURN VALUE

59       Returns CURLE_OK
60

SEE ALSO

62       CURLOPT_HTTP_VERSION(3), CURLOPT_SSLVERSION(3),
63
64
65
66ibcurl 8.2.1                     May 08, 2023             CURLOPT_IPRESOLVE(3)
Impressum