GNURLOPT_IPRESOLVE(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

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