CURLOPT_SOCKS5_AUTH(3)
π CURLOPT_SOCKS5_AUTH β like, the whole manual page, bestie
Okay so this is CURLOPT_SOCKS5_AUTH(3) from the libcurl Library Functions Manual and it's literally all about which auth methods your SOCKS5 proxy is allowed to use π§¦β¨
β¨ NAME β¨
CURLOPT_SOCKS5_AUTH β methods for SOCKS5 proxy authentication π«Ά
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SOCKS5_AUTH, long bitmask);
π¦ DESCRIPTION π¦
So you pass a long as the parameter, right? And it gets set to a bitmask, and that bitmask tells libcurl which authentication method(s) are allowed for SOCKS5 proxy authentication. That's it, that's the whole vibe π
The only supported flags are:
CURLAUTH_BASICβ allows username/password authentication πCURLAUTH_GSSAPIβ allows GSS-API authentication π«CURLAUTH_NONEβ allows no authentication, like, at all π
And if you actually want to set the real username and password? That's a whole different option, bestie β use CURLOPT_PROXYUSERPWD(3) for that β¨
π DEFAULT π
CURLAUTH_BASIC | CURLAUTH_GSSAPI
That's the starting point, no cap π
π PROTOCOLS π
This functionality affects all supported protocols β every single one, she's versatile like that π
β EXAMPLE β
int main(void)
{
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);
}
}
Look at her go π so clean, so iconic π
π§ HISTORY π§
The CURLAUTH_* macros became long types in 7.26.0. Before that version? You had to do a long cast when passing them to curl_easy_setopt(3). Dark times, fr fr π
π AVAILABILITY π
Added in curl 7.55.0 β¨ (she's not ancient, but she's been around π)
π₯ RETURN VALUE π₯
curl_easy_setopt(3) returns a CURLcode indicating success or error π
CURLE_OK(0) β means everything was OK, we ate, no notes π- non-zero β means an error occurred π go check
libcurl-errors(3)for what went wrong
π SEE ALSO π
Go read those too, iykyk π¦
libcurl Β· 2026-10-12 Β· CURLOPT_SOCKS5_AUTH(3) β and that's the whole page, bestie, you're welcome, mwah πβ¨
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms