Go to file
Peter Wu 970c22f970 libcurl: add UNIX domain sockets support
The ability to do HTTP requests over a UNIX domain socket has been
requested before, in Apr 2008 [0][1] and Sep 2010 [2]. While a
discussion happened, no patch seems to get through. I decided to give it
a go since I need to test a nginx HTTP server which listens on a UNIX
domain socket.

One patch [3] seems to make it possible to use the
CURLOPT_OPENSOCKETFUNCTION function to gain a UNIX domain socket.
Another person wrote a Go program which can do HTTP over a UNIX socket
for Docker[4] which uses a special URL scheme (though the name contains
cURL, it has no relation to the cURL library).

This patch considers support for UNIX domain sockets at the same level
as HTTP proxies / IPv6, it acts as an intermediate socket provider and
not as a separate protocol. Since this feature affects network
operations, a new feature flag was added ("unix-sockets") with a
corresponding CURL_VERSION_UNIX_SOCKETS macro.

A new CURLOPT_UNIX_SOCKET_PATH option is added and documented. This
option enables UNIX domain sockets support for all requests on the
handle (replacing IP sockets and skipping proxies).

A new configure option (--enable-unix-sockets) and CMake option
(ENABLE_UNIX_SOCKETS) can disable this optional feature. Note that I
deliberately did not mark this feature as advanced, this is a
feature/component that should easily be available.

 [0]: http://curl.haxx.se/mail/lib-2008-04/0279.html
 [1]: http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/
 [2]: http://sourceforge.net/p/curl/feature-requests/53/
 [3]: http://curl.haxx.se/mail/lib-2008-04/0361.html
 [4]: https://github.com/Soulou/curl-unix-socket

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:19 +01:00
CMake CMake: Simplify if() conditions on check result variables 2014-11-19 11:35:15 +01:00
docs libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
include libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
lib libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
m4 Enable poll on darwin13 2014-05-06 08:31:10 +02:00
packages libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
perl removed trailing whitespace 2011-12-30 03:36:18 +01:00
projects build: Fixed Visual Studio project file generation of strdup.[c|h] 2014-11-05 23:04:43 +00:00
src libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
tests libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
winbuild newlines: fix mixed newlines to LF-only 2014-09-12 10:22:34 +02:00
.gitattributes Tell git to not convert configure-related files. 2012-07-17 20:35:23 +02:00
.gitignore Revert "repository: ignore patch files generated by git" 2014-11-24 15:03:16 +01:00
.travis.yml Adding a .travis.yml file to use the travis-ci.org 2013-10-21 23:15:16 +02:00
acinclude.m4 configure: allow --with-ca-path with PolarSSL too 2014-09-13 14:57:21 +02:00
buildconf buildconf: update copyright year 2014-11-04 19:53:44 +01:00
buildconf.bat curl tool: renaming hugehelp files to tool_hugehelp 2012-12-26 23:30:54 +01:00
CHANGES CHANGES: move all contents from CHANGES to CHANGES.0 2010-06-21 22:27:39 +02:00
CHANGES.0 removed trailing whitespace 2011-12-30 03:36:18 +01:00
CMakeLists.txt libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
configure.ac libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
contributors.sh contributors.sh: --releasenotes reads in names from RELEASE-NOTES 2014-11-06 11:03:06 +01:00
COPYING Bumped copyright year to 2014 2014-01-02 23:53:49 +00:00
CTestConfig.cmake ENH: move dashboard location 2009-07-15 19:40:46 +00:00
curl-config.in curl-config.in: replace tabs by spaces 2013-06-22 22:08:42 +02:00
GIT-INFO curl tool: renaming hugehelp files to tool_hugehelp 2012-12-26 23:30:54 +01:00
install-sh Remove all traces of FBOpenSSL SPNEGO support 2014-07-16 17:26:08 +02:00
libcurl.pc.in build: prevent global LIBS from influencing src and lib build targets 2012-12-03 22:41:18 +01:00
log2changes.pl log2changes.pl: fix the Version output 2012-06-07 23:50:00 +02:00
MacOSX-Framework OS X framework: fix invalid symbolic link 2013-05-09 21:51:35 +02:00
Makefile.am Makefile.am: two cmake files are gone 2014-11-04 08:58:01 +01:00
Makefile.dist Makefile.dist: Added support for WinIDN 2014-11-08 18:31:31 +00:00
maketgz newlines: fix mixed newlines to LF-only 2014-09-12 10:22:34 +02:00
missing
mkinstalldirs Remove all traces of FBOpenSSL SPNEGO support 2014-07-16 17:26:08 +02:00
README various changes of CVS to git 2010-03-22 00:34:09 +01:00
RELEASE-NOTES version: The next release will become 7.40.0 2014-11-30 22:07:36 +00:00

                                  _   _ ____  _
                              ___| | | |  _ \| |
                             / __| | | | |_) | |
                            | (__| |_| |  _ <| |___
                             \___|\___/|_| \_\_____|

README

  Curl is a command line tool for transferring data specified with URL
  syntax. Find out how to use curl by reading the curl.1 man page or the
  MANUAL document. Find out how to install Curl by reading the INSTALL
  document.

  libcurl is the library curl is using to do its job. It is readily
  available to be used by your software. Read the libcurl.3 man page to
  learn how!

  You find answers to the most frequent questions we get in the FAQ document.

  Study the COPYING file for distribution terms and similar. If you distribute
  curl binaries or other binaries that involve libcurl, you might enjoy the
  LICENSE-MIXING document.

CONTACT

  If you have problems, questions, ideas or suggestions, please contact us
  by posting to a suitable mailing list. See http://curl.haxx.se/mail/

  All contributors to the project are listed in the THANKS document.

WEB SITE

  Visit the curl web site for the latest news and downloads:

        http://curl.haxx.se/

GIT

  To download the very latest source off the GIT server do this:

    git clone git://github.com/bagder/curl.git

  (you'll get a directory named curl created, filled with the source code)

NOTICE

  Curl contains pieces of source code that is Copyright (c) 1998, 1999
  Kungliga Tekniska Högskolan. This notice is included here to comply with the
  distribution terms.