curl/src
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
..
macos curl tool: renaming hugehelp files to tool_hugehelp 2012-12-26 23:30:54 +01:00
.gitignore src/: remove version.h.dist from gitignore 2014-10-26 23:17:47 +01:00
CMakeLists.txt cmake: build tool_hugehelp (ENABLE_MANUAL) 2014-10-12 14:11:42 +02:00
Makefile.Watcom build: Renamed CURLX_ONES file list definition to CURLX_CFILES 2014-05-21 23:11:51 +01:00
Makefile.am build: link curl to NSS libraries when NSS support is enabled 2014-07-18 14:20:42 +02:00
Makefile.b32 build: Renamed CURLX_ONES file list definition to CURLX_CFILES 2014-05-21 23:11:51 +01:00
Makefile.inc curl_easy_duphandle: CURLOPT_COPYPOSTFIELDS read out of bounds 2014-11-05 08:05:14 +01:00
Makefile.m32 build: in Makefile.m32 simplified autodetection. 2014-12-01 16:39:56 +01:00
Makefile.netware Added NetWare support to build with nghttp2. 2014-10-29 03:31:34 +01:00
Makefile.vc6 Makefile.vc6: Added support for WinIDN 2014-11-08 18:31:29 +00:00
curl.rc curl tool: reviewed code moved to tool_*.[ch] files 2011-10-06 17:39:00 +02:00
makefile.amiga build: Renamed CURLX_ONES file list definition to CURLX_CFILES 2014-05-21 23:11:51 +01:00
makefile.dj Makefile.inc: fix $(top_srcdir) not allowed in _SOURCES variables 2013-01-20 04:20:02 +01:00
mkhelp.pl mkhelp: generate code for --disable-manual as well 2014-03-26 13:22:10 +01:00
tool_binmode.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_binmode.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_bname.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_bname.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_cb_dbg.c tool: Moved internal variable isatty to the global config 2014-03-01 18:30:16 +00:00
tool_cb_dbg.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_cb_hdr.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_cb_hdr.h Fixes allowing 26 more test cases in 1334 to 1393 range to succeed 2012-06-09 05:49:49 +02:00
tool_cb_prg.c tool: Moved --stderr to the global config 2014-03-01 13:03:20 +00:00
tool_cb_prg.h tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_cb_rea.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_cb_rea.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_cb_see.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_cb_see.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_cb_wrt.c tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_cb_wrt.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_cfgable.c curl tool: Exclude SMB from the protocol redirect 2014-11-30 21:39:04 +00:00
tool_cfgable.h SSL: implement public key pinning 2014-10-07 14:44:19 +02:00
tool_convert.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_convert.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_dirhie.c checksrc: ban unsafe functions 2013-03-07 11:08:05 +01:00
tool_dirhie.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_doswin.c tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_doswin.h tool: Fixed line longer than 79 characters from commit 705a4cb549 2014-02-23 16:13:09 +00:00
tool_easysrc.c tool: Fixed libcurl source output for multiple operations 2014-03-02 09:44:18 +00:00
tool_easysrc.h tool: Moved --libcurl to the global config 2014-03-01 17:23:14 +00:00
tool_formparse.c tool_formparse.c: fix possible use of non-null-terminated strings 2014-04-19 00:17:47 +02:00
tool_formparse.h tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_getparam.c SSL: implement public key pinning 2014-10-07 14:44:19 +02:00
tool_getparam.h tool_getparam: Added initial support for --next/-: 2014-02-26 20:42:30 +00:00
tool_getpass.c getpass: fix password parsing from console 2014-01-28 13:28:00 +01:00
tool_getpass.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_help.c libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
tool_help.h tool_getparam: Moved version information into separate function in tool_help 2014-02-22 17:47:13 +00:00
tool_helpers.c tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_helpers.h tool: Fixed line longer than 79 characters from commit 705a4cb549 2014-02-23 16:13:09 +00:00
tool_homedir.c VMS: fix and generate the VMS build config 2013-02-05 23:08:57 +01:00
tool_homedir.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_hugehelp.c.cvs tool_hugehelp.c.cvs: Added copyright 2014-08-10 20:38:06 +01:00
tool_hugehelp.h tool_hugehelp: partially reverted 24e22e10 2014-02-24 21:30:36 +01:00
tool_libinfo.c curl tool: Enable support for the SMB protocol 2014-11-30 21:32:44 +00:00
tool_libinfo.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_main.c tool: oops, forgot to include <plarenas.h> 2014-07-03 20:36:49 +02:00
tool_main.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_metalink.c tool_metalink: Support polarssl as digest provider 2014-06-17 00:42:53 +02:00
tool_metalink.h tool_metalink.h: Fixed compilation warning 2014-03-01 20:16:33 +00:00
tool_mfiles.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_mfiles.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_msgs.c tool: Moved --stderr to the global config 2014-03-01 13:03:20 +00:00
tool_msgs.h tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_operate.c operate: avoid NULL dereference 2014-10-08 13:18:55 +02:00
tool_operate.h tool_main: Moved easy handle into global config structure 2014-02-24 20:01:37 +00:00
tool_operhlp.c get_url_file_name: make no slash equal empty string 2014-10-09 16:42:17 +02:00
tool_operhlp.h tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_panykey.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_panykey.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_paramhlp.c curl tool: Enable support for the SMB protocol 2014-11-30 21:32:44 +00:00
tool_paramhlp.h tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_parsecfg.c parseconfig: skip a NULL check 2014-10-07 10:29:06 +02:00
tool_parsecfg.h tool_getparam: Added global config to getparameter() 2014-02-25 19:38:17 +00:00
tool_sdecls.h tool_cfgable: Renamed Configurable structure to OperationConfig 2014-02-23 13:09:20 +00:00
tool_setopt.c curl tool: Enable support for the SMB protocol 2014-11-30 21:32:44 +00:00
tool_setopt.h tool: Moved --libcurl to the global config 2014-03-01 17:23:14 +00:00
tool_setup.h curl_easy_duphandle: CURLOPT_COPYPOSTFIELDS read out of bounds 2014-11-05 08:05:14 +01:00
tool_sleep.c tool_go_sleep: use (void) to spell out we ignore the return value 2014-10-06 08:53:35 +02:00
tool_sleep.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_strdup.c tool_strdup.c: include the tool strdup.h 2014-11-05 23:33:22 +01:00
tool_strdup.h curl_easy_duphandle: CURLOPT_COPYPOSTFIELDS read out of bounds 2014-11-05 08:05:14 +01:00
tool_urlglob.c Fixed some "statement not reached" warnings 2014-07-12 01:45:26 +02:00
tool_urlglob.h urlglob: improved error messages and column number on bad use 2013-09-06 23:27:47 +02:00
tool_util.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_util.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_version.h curl tool: reviewed code moved to tool_*.[ch] files 2011-10-06 17:39:00 +02:00
tool_vms.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_vms.h vms_show: post VMS patch cleanup - II 2013-02-06 04:51:55 +01:00
tool_writeenv.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tool_writeenv.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_writeout.c tool_writeout.c: initialize string pointer variable 2014-04-19 00:24:25 +02:00
tool_writeout.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
tool_xattr.c xattr: add support for FreeBSD xattr API 2013-10-01 22:53:47 +02:00
tool_xattr.h curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00