GNURLOPT_PROXYUSERPWD(3)
π 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
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms