GNURLOPT_PROXYUSERPWD(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to the GNURLOPT_PROXYUSERPWD(3) page β€” it's part of the curl_easy_setopt options crew, and the actual option is CURLOPT_PROXYUSERPWD: the user name and password you use for proxy authentication πŸ’…

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERPWD, char *userpwd);

πŸ¦‹ DESCRIPTION πŸ¦‹

You pass a char * as the parameter, and it should be [user name]:[password] for the connection to the HTTP proxy. Both the name and the password are URL decoded before they get used, so if you want a colon in the user name, for example, you've gotta encode it as %3A.

⚠️ heads up, bestie: this is different to how CURLOPT_USERPWD(3) is used β€” beware, okay? 😭

If you need to specify the authentication method, that's what CURLOPT_PROXYAUTH(3) is for.

Good news: your application does not have to keep the string around after setting this option. Set it and move on, periodt ✨

🌸 DEFAULT 🌸

This is NULL by default β€” iconic, minimal, no notes.

πŸ”₯ PROTOCOLS πŸ”₯

Used with all protocols that can use a proxy 🫢

πŸ“ EXAMPLE πŸ“

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
  curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
  curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "clark%20kent:superman");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

πŸ’œ AVAILABILITY πŸ’œ

Always. Literally always 🫢

🌈 RETURN VALUE 🌈

Returns CURLE_OK if proxies are supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. That's the whole mood.

πŸ‘‘ SEE ALSO πŸ‘‘

go peek at CURLOPT_PROXY(3) and CURLOPT_PROXYTYPE(3), β€” iykyk πŸ‘€

okay that's the tea β˜• β€” this page comes from libcurl 7.37.0, dated 17 Jun 2014, and it's the GNURLOPT_PROXYUSERPWD(3) manual page. mwah πŸ’‹

πŸ“¦ where this page comes from