CURLINFO_USED_PROXY(3)
π CURLINFO_USED_PROXY β did this transfer use a proxy? π
okay bestie, this is the CURLINFO_USED_PROXY(3) page from the Library Functions Manual (libcurl edition πΈ). Itβs giving βtiny but iconic proxy vibe check,β and honestly weβre obsessed.
β¨ NAME β¨
CURLINFO_USED_PROXY β whether the transfer used a proxy π«Ά
π SYNOPSIS π
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_USED_PROXY,
long *authp);
π¦ DESCRIPTION π¦
okay so you pass a pointer to a long, no cap. After the previous transfer, that long gets set to zero if no proxy was used, or to a non-zero value if a proxy was used. Thatβs literally the whole vibe check π
lowkey important: this tells you about the previous transfer, not some future one. periodt.
π PROTOCOLS π
This functionality affects all supported protocols. slay, universal queen behavior π
π₯ EXAMPLE π₯
int main(int argc, char *argv[])
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
curl_easy_setopt(curl, CURLOPT_PROXY, "http://127.0.0.1:80");
curl_easy_setopt(curl, CURLOPT_NOPROXY, "example.com");
result = curl_easy_perform(curl);
if(!result) {
/* extract the available proxy authentication types */
long used;
result = curl_easy_getinfo(curl, CURLINFO_USED_PROXY, &used);
if(!result) {
printf("The proxy was %sused\n", used ? "" : "NOT ");
}
}
curl_easy_cleanup(curl);
}
}
π§ AVAILABILITY π§
Added in curl 8.7.0. so if ur on something older, itβs not giving what u need, bestie π
π RETURN VALUE π
curl_easy_getinfo(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) for the full tea β
πΈ SEE ALSO πΈ
π source/version: libcurl Β· date: 2026-10-12 Β· mwah, bye 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