curl/include/curl
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
..
.gitignore curl tool: use configuration files from lib directory 2012-04-06 23:37:05 +02:00
curl.h libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
curlbuild.h.cmake cmake: unbreak for non-Windows platforms 2013-10-20 17:12:56 +02:00
curlbuild.h.dist curlbuild: fix GCC build on SPARC systems without configure script 2014-06-16 21:44:28 +02:00
curlbuild.h.in build: fix AIX compilation and usage 2012-11-23 17:57:00 +01:00
curlrules.h build: fix circular header inclusion with other packages 2013-01-09 00:49:50 +01:00
curlver.h version: The next release will become 7.40.0 2014-11-30 22:07:36 +00:00
easy.h Fix spelling errors in include/ 2011-04-21 07:55:53 -07:00
Makefile.am include: cleanup 2011-05-09 10:20:31 +02:00
mprintf.h checksrc: ban unsafe functions 2013-03-07 11:08:05 +01:00
multi.h CURLM_ADDED_ALREADY: new error code 2013-08-20 23:13:19 +02:00
stdcheaders.h remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
typecheck-gcc.h curl.h: reverse the enum/define setup for old symbols 2014-06-17 10:02:41 +02:00