CURLOPT_SOCKS5_GSSAPI_SERVICE(3)

πŸ’… CURLOPT_SOCKS5_GSSAPI_SERVICE β€” bestie's guide

okay so this is a page from the libcurl manual (Library Functions Manual, if we're being fancy ✨), and it's all about CURLOPT_SOCKS5_GSSAPI_SERVICE. Yes the name is a mouthful, no I will not be shortening it, it's iconic and we respect it. πŸŽ€


✨ NAME ✨

CURLOPT_SOCKS5_GSSAPI_SERVICE β€” literally the SOCKS5 proxy authentication service name. that's it, that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SOCKS5_GSSAPI_SERVICE,
                          char *name);

look at her. three lines, one function, zero chill. 🫢


✨ DESCRIPTION ✨

okay bestie, first things first, and I need you to hear me on this one:

Deprecated since 7.49.0. Use CURLOPT_PROXY_SERVICE_NAME(3) instead. like, please. she's retired, she's living her best life in the archive, let her rest. 😭

so what does she even do? you pass a char pointer as the parameter, pointing at a string that holds the name of the service. that's the whole job. πŸ’…

the default service name for a SOCKS5 server is rcmd. lowkey iconic default honestly. but this option is what lets you change it, so if rcmd isn't your moment, you can swap it out. main character energy. πŸ‘‘

and the best part? the application does not have to keep the string around after setting this option. so you can let it go, no strings attached (pun fully intended, I'm hilarious). ✨


✨ DEFAULT ✨

See above πŸ‘€ β€” that's it, that's the answer. the default's already up there, go look, I believe in you. 🌸


✨ PROTOCOLS ✨

this functionality affects all supported protocols. every single one. no cap. 🌈


✨ EXAMPLE ✨

here's the actual code, character for character, no notes:

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
    curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://proxy");
    curl_easy_setopt(curl, CURLOPT_SOCKS5_GSSAPI_SERVICE, "rcmd-special");
    result = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
}

not me staring at "rcmd-special" like it's the most creative thing I've ever seen πŸ’€ it ate, honestly.


✨ DEPRECATED ✨

Deprecated since 7.49.0. yeah. again. I told you. she's deprecated, she's still gorgeous, but she's deprecated. πŸ™ˆ


✨ AVAILABILITY ✨

Added in curl 7.19.4 πŸŽ€ so she's been around a while, she's seen things.


✨ RETURN VALUE ✨

curl_easy_setopt(3) returns a CURLcode indicating success or error. so nice of her to tell us. πŸ’–

CURLE_OK (0) means everything was OK β€” slay, we love a zero. anything non-zero means an error occurred, and you should go check libcurl-errors(3) for the tea. ⭐


✨ SEE ALSO ✨

both linked, both valid, go read them, iykyk πŸ¦‹


that's the whole page bestie, go forth and configure your proxies responsibly πŸ’œ

sign-off szn: this was libcurl, dated 2026-10-12, and honestly? she served. periodt. πŸ’…πŸŽ€βœ¨
πŸ“¦ where this page comes from