2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Adding support for UNIX Sockets

This commit is contained in:
Starfox64
2017-09-04 17:06:19 +02:00
parent 07a7b7c84c
commit 85a48b2eaa
2 changed files with 11 additions and 2 deletions
Regular → Executable
+7 -2
View File
@@ -72,8 +72,6 @@ module.exports = function httpAdapter(config) {
var agent = isHttps ? config.httpsAgent : config.httpAgent;
var options = {
hostname: parsed.hostname,
port: parsed.port,
path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
method: config.method,
headers: headers,
@@ -81,6 +79,13 @@ module.exports = function httpAdapter(config) {
auth: auth
};
if (config.socketPath) {
options.socketPath = config.socketPath;
} else {
options.hostname = parsed.hostname;
options.port = parsed.port;
}
var proxy = config.proxy;
if (!proxy && proxy !== false) {
var proxyEnv = protocol.slice(0, -1) + '_proxy';