CURLOPT_PROXYPASSWORD(3)

πŸ’… CURLOPT_PROXYPASSWORD(3) β€” bestie's guide to the proxy password ✨

Okay so this is a page from the libcurl manual, and it's all about CURLOPT_PROXYPASSWORD β€” the option that hands your proxy its password. Buckle up, it's actually so simple, no cap πŸŽ€


✨ NAME ✨

CURLOPT_PROXYPASSWORD β€” the password you use for proxy authentication 🫢


🌸 SYNOPSIS 🌸

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPASSWORD, char *pwd);

πŸ¦‹ DESCRIPTION πŸ¦‹

So you pass a char pointer as the parameter, right? And that pointer should be pointing at a null-terminated password β€” like, the actual password string you're gonna use to authenticate with the proxy. That's it. That's the whole vibe πŸ’œ

The CURLOPT_PROXYPASSWORD(3) option should be used in conjunction with the CURLOPT_PROXYUSERNAME(3) option β€” they're giving duo energy, you need both for the pairing to make sense πŸ‘‘

Good news: your app does not have to keep the string around after setting this option. Once you've set it, you can let it go β€” it's not your problem anymore, bestie 😌

Set it multiple times? Cool, totally fine β€” using this option multiple times makes the last set string override the previous ones. Last one wins, periodt. And if you set it to NULL, that disables its use again 🚫


πŸŽ€ DEFAULT πŸŽ€

blank

(yeah, it starts out empty β€” you gotta fill it in yourself, icon behavior honestly ✨)


🌈 PROTOCOLS 🌈

This functionality affects all supported protocols πŸ’« like, every single one, no exceptions.


πŸ“ EXAMPLE πŸ“

Okay here's the whole thing in action β€” copy it, run it, live your truth:

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);
  }
}

See how mrsmith and qwerty are just vibing there together? That's the username/password combo doing its thing πŸ’…


⭐ AVAILABILITY ⭐

Added in curl 7.19.1 β€” vintage at this point, honestly 🧚


πŸ”₯ RETURN VALUE πŸ”₯

curl_easy_setopt(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK β€” slay. Non-zero means an error occurred, so go check libcurl-errors(3) to find out what went wrong 😭


πŸ’– SEE ALSO πŸ’–

All the siblings, all iconic, go read them 🫢


And that's the whole page, bestie β€” brought to you by the libcurl gang, dated 2026-10-12, straight from their manual, version and all πŸ’œβœ¨ Go forth and authenticate your proxy πŸ‘‘

πŸ“¦ where this page comes from