summaryrefslogtreecommitdiff
path: root/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.3
diff options
context:
space:
mode:
Diffstat (limited to 'docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.3')
-rw-r--r--docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.330
1 files changed, 14 insertions, 16 deletions
diff --git a/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.3 b/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.3
index b335fa888..bb6b521ab 100644
--- a/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.3
+++ b/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -40,12 +40,10 @@ curl does not need to resolve the DNS hostname in the URL.
The maximum path length on Cygwin, Linux and Solaris is 107. On other platforms
it might be even less.
-Proxy and TCP options such as
-.BR CURLOPT_TCP_NODELAY "(3)
-are not supported. Proxy options such as
-.BR CURLOPT_PROXY "(3)
-have no effect either as these are TCP-oriented, and asking a proxy server to
-connect to a certain Unix domain socket is not possible.
+Proxy and TCP options such as \fICURLOPT_TCP_NODELAY(3)\fP are not
+supported. Proxy options such as \fICURLOPT_PROXY(3)\fP have no effect either
+as these are TCP-oriented, and asking a proxy server to connect to a certain
+Unix domain socket is not possible.
The application does not have to keep the string around after setting this
option.
@@ -59,19 +57,19 @@ Given that you have an nginx server running, listening on /tmp/nginx.sock, you
can request an HTTP resource with:
.nf
- curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
- curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
+ curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
+ curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
.fi
-If you are on Linux and somehow have a need for paths larger than 107 bytes, you
-could use the proc filesystem to bypass the limitation:
+If you are on Linux and somehow have a need for paths larger than 107 bytes,
+you could use the proc filesystem to bypass the limitation:
.nf
- int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
- char path[108];
- snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
- curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
- /* Be sure to keep dirfd valid until you discard the handle */
+ int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
+ char path[108];
+ snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
+ curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
+ /* Be sure to keep dirfd valid until you discard the handle */
.fi
.SH AVAILABILITY
Since 7.40.0.