Imported Upstream version 7.44.0
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_UNIX_SOCKET_PATH.html
index 17fcef6..1b50449 100644 (file)
@@ -4,15 +4,20 @@
 <title>CURLOPT_UNIX_SOCKET_PATH man page</title>
 <meta name="generator" content="roffit">
 <STYLE type="text/css">
-P.level0 {
+pre {
+  overflow: auto;
+  margin: 0;
+}
+
+P.level0, pre.level0 {
  padding-left: 2em;
 }
 
-P.level1 {
+P.level1, pre.level1 {
  padding-left: 4em;
 }
 
-P.level2 {
+P.level2, pre.level2 {
  padding-left: 6em;
 }
 
@@ -47,7 +52,7 @@ p.roffit {
 
 <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
 <p class="level0">CURLOPT_UNIX_SOCKET_PATH - set Unix domain socket <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
-<p class="level0">#include &lt;curl/curl.h&gt; 
+<p class="level0">&#35;include &lt;curl/curl.h&gt; 
 <p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UNIX_SOCKET_PATH, char *path); <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
 <p class="level0">Enables the use of Unix domain sockets as connection endpoint and sets the path to <span Class="emphasis">path</span>. If <span Class="emphasis">path</span> is NULL, then Unix domain sockets are disabled. An empty string will result in an error at some point, it will not disable use of Unix domain sockets. 
 <p class="level0">When enabled, cURL will connect to the Unix domain socket instead of establishing a TCP connection to a host. Since no TCP connection is created, cURL does not need to resolve the DNS hostname in the URL. 
@@ -56,20 +61,20 @@ p.roffit {
 <p class="level0">Default is NULL, meaning that no Unix domain sockets are used. <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
 <p class="level0">All protocols except for file:// and FTP are supported in theory. HTTP, IMAP, POP3 and SMTP should in particular work (including their SSL/TLS variants). <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
 <p class="level0">Given that you have an nginx server running, listening on /tmp/nginx.sock, you can request a HTTP resource with: 
-<p class="level0"><pre>
-<p class="level0">&nbsp;   curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
- &nbsp;   curl_easy_setopt(curl_handle, CURLOPT_URL, "<a href="http://localhost/">http://localhost/</a>");
- </pre>
+<p class="level0"><pre class="level0">
+&nbsp;   curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
+&nbsp;   curl_easy_setopt(curl_handle, CURLOPT_URL, "<a href="http://localhost/">http://localhost/</a>");
+</pre>
 
 <p class="level0">
 <p class="level0">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: 
-<p class="level0"><pre>
-<p class="level0">&nbsp;   int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
- &nbsp;   char path[108];
- &nbsp;   snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
- &nbsp;   curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
- &nbsp;   /* Be sure to keep dirfd valid until you discard the handle */
- </pre>
+<p class="level0"><pre class="level0">
+&nbsp;   int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
+&nbsp;   char path[108];
+&nbsp;   snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
+&nbsp;   curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
+&nbsp;   /* Be sure to keep dirfd valid until you discard the handle */
+</pre>
 
 <p class="level0"><a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
 <p class="level0">Since 7.40.0. <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>