curl/tests/server
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 gitignore: ignore fake_ntlm 2011-07-18 23:49:31 +02:00
base64.pl utility to base encode data passed on stdin 2004-11-29 12:09:05 +00:00
CMakeLists.txt cmake: add ENABLE_THREADED_RESOLVER, rename ARES 2014-11-10 09:09:25 +01:00
fake_ntlm.c test servers: fix errno, ERRNO and SOCKERRNO usage for W32/W64 2013-01-09 22:23:50 +01:00
getpart.c base64: Fixed compilation warnings when using Curl_base64_decode() 2013-11-03 12:25:07 +00:00
getpart.h test servers: build adjustment 2012-04-10 17:32:06 +02:00
Makefile.am build: fix circular header inclusion with other packages 2013-01-09 00:49:50 +01:00
Makefile.inc Makefile.inc: fix $(top_srcdir) not allowed in _SOURCES variables 2013-01-20 04:20:02 +01:00
resolve.c tests: fix memleak in server/resolve.c 2014-11-10 09:06:48 +01:00
rtspd.c test servers: handle W32/W64 SIGBREAK with exit_signal_handler 2013-01-09 22:23:50 +01:00
server_setup.h build: fix circular header inclusion with other packages 2013-01-09 00:49:50 +01:00
server_sockaddr.h sws: add UNIX domain socket support 2014-12-04 02:52:18 +01:00
sockfilt.c sockfilt.c: clean up threaded approach and add documentation 2014-04-22 17:22:42 +02:00
sws.c libcurl: add UNIX domain sockets support 2014-12-04 02:52:19 +01:00
testpart.c Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tftp.h Revert changes relative to lib/*.[ch] recent renaming 2013-01-06 18:20:27 +01:00
tftpd.c tests: Fix portability issue with the tftpd server and timeouts 2014-05-29 09:39:39 +02:00
util.c util.c: Revert workaround eeefcdf, 6eb56e7 and e3787e8 2013-04-06 11:55:30 +02:00
util.h test servers: build adjustment 2012-04-10 17:32:06 +02:00