httpc: allow to use unix socket as connection endpoint
This patch adds a new connection option to http client, 'unix_socket'. The option specifies the path to the unix socket to use as connection endpoint instead of TCP: httpc = require('http.client') httpc.request('GET', 'http://localhost/index.html', nil, {unix_socket = '/var/run/docker.sock'}) The option is supported only if tarantool was built with libcurl 7.40.0 or newer. For older versions, an attempt to use the option will result in a Lua exception. Suggested and first implemented by @rosik. The test was refactored by @locker. Closes #3040
Showing
- src/httpc.c 17 additions, 0 deletionssrc/httpc.c
- src/httpc.h 12 additions, 0 deletionssrc/httpc.h
- src/lua/httpc.c 9 additions, 0 deletionssrc/lua/httpc.c
- test/app-tap/http_client.test.lua 117 additions, 59 deletionstest/app-tap/http_client.test.lua
- test/app-tap/httpd.py 25 additions, 6 deletionstest/app-tap/httpd.py
Loading
Please register or sign in to comment