CURLINFO_PROXYAUTH_USED(3)
β¨ CURLINFO_PROXYAUTH_USED(3) β¨
okay bestie so we're in the Library Functions Manual today and this one is genuinely a little gem π it's CURLINFO_PROXYAUTH_USED, and yes it's giving very specific-girlie energy but that's literally the point π
πΈ NAME πΈ
CURLINFO_PROXYAUTH_USED β the HTTP proxy authentication method, aka "which auth flavor did the proxy actually make me use" π΅οΈββοΈ
π SYNOPSIS π
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXYAUTH_USED, long *authp);
π¦ DESCRIPTION π¦
so here's the vibe: you pass in a pointer to a long, and it gets filled with a bitmask telling you which authentication method was used in the previous request that went down over an HTTP proxy π
the meaning of each possible bit? that's explained over in the CURLOPT_HTTPAUTH(3) option for curl_easy_setopt(3) β go read that one, iykyk π
the returned value has zero or one bit set. zero or one. no in-between, no chaos, just math being math β¨
π§ PROTOCOLS π§
this functionality affects http only β like, that's it, that's the whole list, don't come for her π«Ά
π₯ EXAMPLE π₯
here's the whole thing, living its best life:
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example");
curl_easy_setopt(curl, CURLOPT_PROXYAUTH,
CURLAUTH_BASIC | CURLAUTH_DIGEST);
curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "shrek");
curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "swamp");
result = curl_easy_perform(curl);
if(!result) {
long auth;
result = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_USED, &auth);
if(!result) {
if(!auth)
printf("No auth used\n");
else {
if(auth == CURLAUTH_DIGEST)
printf("Used Digest proxy authentication\n");
else
printf("Used Basic proxy authentication\n");
}
}
}
curl_easy_cleanup(curl);
}
}
(and yes the credentials are literally shrek / swamp. no notes. iconic. π)
β AVAILABILITY β
added in curl 8.12.0 β so if your curl is older than that, this info straight up does not exist for you, sorry bestie π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode telling you success or error, that's the whole deal:
CURLE_OK(0) β everything was OK, slay π- non-zero β an error occurred, go check
libcurl-errors(3)for what it means π
π SEE ALSO π
π reminder bestie: the value is a bitmask and it comes back with zero or one bit set β so don't go treating it like a free-for-all combo platter, okay? π«Ά
k that's the whole page, mwah π this came from libcurl dated 2026-10-12, and the page itself is CURLINFO_PROXYAUTH_USED(3) β go forth and auth your proxies responsibly, bestie πβ¨π
π¦ 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