CURLOPT_ADDRESS_SCOPE(3)
π CURLOPT_ADDRESS_SCOPE(3) π
okay bestie, this page is chilling in the Library Functions Manual and it's fully about the scope id for IPv6 addresses. it's giving tiny-but-iconic setopt energy, no cap. π¦
πΈ NAME πΈ
CURLOPT_ADDRESS_SCOPE β scope id for IPv6 addresses β¨
π SYNOPSIS π
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ADDRESS_SCOPE, long scope);
π DESCRIPTION π
Pass a long specifying the scope id value to use when connecting to IPv6 addresses. that's the whole vibe, bestie β a long, a scope id, and IPv6. periodt. π
π DEFAULT π
0 β yep, zero is the default, fr fr.
π PROTOCOLS π
This functionality affects all supported protocols. literally all the supported ones, bestie. β¨
π§ EXAMPLE π§
#include <net/if.h> /* for if_nametoindex() */
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
long my_scope_id;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
my_scope_id = if_nametoindex("eth0");
curl_easy_setopt(curl, CURLOPT_ADDRESS_SCOPE, my_scope_id);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
β AVAILABILITY β
Added in curl 7.19.0 β iconic since then, iykyk. π«
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK, non-zero means an error occurred β see libcurl-errors(3). Returns CURLE_BAD_FUNCTION_ARGUMENT if set to a negative value. so yeah, don't be negative, bestie ππ
π«Ά SEE ALSO π«Ά
mwah π this cutie page is from libcurl, dated 2026-10-12, and it's the CURLOPT_ADDRESS_SCOPE(3) page β slay. π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms