CURLOPT_AB...NIX_SOCKET(3)
π CURLOPT_ABSTRACT_UNIX_SOCKET(3) π
okay bestie, this is the libcurl Library Functions Manual page for CURLOPT_ABSTRACT_UNIX_SOCKET(3) β and honestly, abstract Unix sockets are lowkey iconic once you get the vibe. π
πΈ NAME πΈ
CURLOPT_ABSTRACT_UNIX_SOCKET β abstract Unix domain socket. That's the whole name, no cap. β¨
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ABSTRACT_UNIX_SOCKET,
char *path);
π DESCRIPTION π
okay so this option enables the use of an abstract Unix domain socket instead of establishing a TCP connection to a host. The parameter should be a char * pointing to a null-terminated string that holds the path of the socket. The path gets set to path prefixed by a NULL byte. That's the convention for abstract sockets, bestie.
But it should be stressed β like, big emphasis β that the path you pass to this function should not contain a leading NULL byte. Do not do that. π
On platforms that don't support this, the abstract address gets interpreted as an empty string and fails gracefully, generating a runtime error. Not the slayest outcome, but that's what the manual says. π
This option shares the same semantics as CURLOPT_UNIX_SOCKET_PATH(3) β more details can be found in that documentation. Internally, these two options share the same storage, and therefore only one of them can be set per handle. periodt. π
π DEFAULT π
The default is literally NULL. π
π PROTOCOLS π
This functionality affects all supported protocols. All of them. Every single one. β¨
π EXAMPLE π
Here's the example, exactly as the manual gives it β steal it for your own code, bestie:
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_ABSTRACT_UNIX_SOCKET, "/tmp/foo.sock");
curl_easy_setopt(curl, CURLOPT_URL, "http://localhost/");
/* Perform the request */
curl_easy_perform(curl);
}
}
β AVAILABILITY β
Added in curl 7.53.0. A little vintage, still serving. π«Ά
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK. non-zero means an error occurred β see libcurl-errors(3). No mystery, just error codes. π
π§ SEE ALSO π§
Go read those too, iykyk. π
That's the whole page, bestie. Sending you love from source/version: libcurl Β· date: 2026-10-12 β now go set that socket and slay π
π¦ 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