GNURLOPT_IPRESOLVE(3)
GNURLOPT_IPRESOLVE(3) π β¨
okay so bestie, this page is from the curl_easy_setopt options manual, and it's here to help you specify which IP protocol version to use π«Ά
πΈ NAME πΈ
CURLOPT_IPRESOLVE β specify which IP protocol version to use π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_IPRESOLVE, long resolve);
π DESCRIPTION π
This lets an application select what kind of IP addresses to use when resolving host names. This is only interesting when you're using host names that resolve addresses using more than one version of IP. The allowed values are:
CURL_IPRESOLVE_WHATEVERβ default; resolves addresses to all IP versions that your system allows.CURL_IPRESOLVE_V4β resolve to IPv4 addresses.CURL_IPRESOLVE_V6β resolve to IPv6 addresses.
π DEFAULT π
CURL_IPRESOLVE_WHATEVER β the default, periodt π
π¦ PROTOCOLS π¦
All β all of them β¨
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
/* resolve host name using IPv6-names only */
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
π AVAILABILITY π
Always β always always π
π RETURN VALUE π
Returns CURLE_OK β we love a successful vibe check π
π₯ SEE ALSO π₯
CURLOPT_HTTP_VERSION(3), CURLOPT_SSLVERSION(3), β go peek at those too, bestie β¨
mwah π this iconic little page is from libcurl 7.37.0, dated 19 Jun 2014 β ily, bye! π«Άπ
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms