GNURLOPT_SOCKS5_AUTH(3)
bestie, welcome to the GNURLOPT_SOCKS5_AUTH(3) page, straight out of the curl_easy_setopt options manual β and yes, we're talking about SOCKS5 proxy auth, so let's get into it π
β¨ NAME β¨
CURLOPT_SOCKS5_AUTH β sets the allowed methods for SOCKS5 proxy authentication. That's the whole assignment, and it ate π
π¦ SYNOPSIS π¦
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SOCKS5_AUTH, long
bitmask);
πΈ DESCRIPTION πΈ
Okay so you pass a long as the parameter, and it gets set to a bitmask. That bitmask tells libcurl which authentication method(s) are allowed for SOCKS5 proxy authentication. No cap, that's literally the job π«Ά
The only supported flags are:
CURLAUTH_BASICβ allows username/password authenticationCURLAUTH_GSSAPIβ allows GSS-API authenticationCURLAUTH_NONEβ allows no authentication
Set the actual user name and password with the CURLOPT_PROXYUSERPWD(3) option. That's where the credentials go, bestie π
π DEFAULT π
CURLAUTH_BASIC|CURLAUTH_GSSAPI
That's the default vibe, periodt β¨
π PROTOCOLS π
All β every protocol, no gatekeeping π«
π₯ EXAMPLE π₯
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* request to use a SOCKS5 proxy */
curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://user:pass@myproxy.com");
/* enable username/password authentication only */
curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, CURLAUTH_BASIC);
/* Perform the request */
curl_easy_perform(curl);
}
β AVAILABILITY β
Added in 7.55.0, so she's been around π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_NOT_BUILT_IN if the bitmask contains unsupported flags. So likeβ¦ check your bitmask, bestie, because unsupported flags are giving error energy π
π SEE ALSO π
xoxo, libcurl 7.55.0, dated 27 April 2017 β page GNURLOPT_SOCKS5_AUTH(3) out ππ
β¨
π¦ 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