CURLOPT_PROXYUSERNAME(3)
okay so bestie, welcome to the libcurl manual page for CURLOPT_PROXYUSERNAME(3) β yes, the whole page is about the username to use for proxy authentication, and it's lowkey iconic. π
β¨ NAME β¨
CURLOPT_PROXYUSERNAME β username to use for proxy authentication. that's the vibe. π
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERNAME,
char *username);
π DESCRIPTION π
Pass a char * pointer as the parameter, and it should be pointing to the null-terminated username to use for the transfer. literally just give it the username string, bestie. β¨
CURLOPT_PROXYUSERNAME(3) sets the username to be used in protocol authentication with the proxy. that's the whole assignment. π«Ά
To specify the proxy password, use CURLOPT_PROXYPASSWORD(3). password goes there, username goes here β keep the pair cute and separate. π
The application does not have to keep the string around after setting this option. so you don't gotta babysit that string after you set it. π
π DEFAULT π
blank. that's the default. π
π PROTOCOLS π
This functionality affects all supported protocols. all of them. no cap. π
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith");
curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
β AVAILABILITY β
Added in curl 7.19.1. that's when this icon was born, bestie. β
π₯ 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). if it's non-zero, it's giving error β go check that page. π₯
π SEE ALSO π
mwah π β libcurl manual page, dated 2026-10-12, all about CURLOPT_PROXYUSERNAME(3).
π¦ 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