GNURLOPT_PROXYUSERNAME(3)

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

✨ NAME ✨

This is the GNURLOPT_PROXYUSERNAME(3) page, hanging out in the curl_easy_setopt options manual, bestie πŸ’… and the actual name of the thing is CURLOPT_PROXYUSERNAME: the user name to use for proxy authentication. Periodt.

πŸŽ€ SYNOPSIS πŸŽ€

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERNAME,
                                 char *username);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so you pass a char * as the parameter, and it should be pointing to the null-terminated user name to use for the transfer. No cap.

CURLOPT_PROXYUSERNAME(3) sets the user name to be used in protocol authentication with the proxy. It’s giving proxy-auth main character energy πŸ”₯

To specify the proxy password, use CURLOPT_PROXYPASSWORD(3). Iykyk.

And the application does not have to keep the string around after setting this option β€” lowkey convenient, fr fr.

🌸 DEFAULT 🌸

blank

🧚 PROTOCOLS 🧚

Most

πŸ“ 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_PROXYUSERNAME, "mrsmith");
  curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

πŸ‘‘ AVAILABILITY πŸ‘‘

Added in 7.19.1 β€” vintage but iconic, honestly.

πŸ’– RETURN VALUE πŸ’–

Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. Slay.

🌈 SEE ALSO 🌈


Cute lil footer check, bestie: this page is from libcurl 7.37.0, dated 19 Jun 2014, and its manual title is GNURLOPT_PROXYUSERNAME(3). Bye and go proxy-auth responsibly 🫢✨

πŸ“¦ where this page comes from