2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-27 14:47:43 +03:00

Added proxy option to http.js

This commit is contained in:
msangui
2015-10-26 13:10:27 -03:00
committed by Nick Uraltsev
parent 6bb376d9f1
commit 775ca3e732
+6
View File
@@ -63,6 +63,12 @@ module.exports = function httpAdapter(resolve, reject, config) {
auth: auth
};
if (config.proxy) {
options.host = config.proxy.host;
options.port = config.proxy.port;
options.path = parsed.protocol + '//' + parsed.hostname + buildUrl(parsed.path, config.params).replace(/^\?/, '')
}
// Create the request
var transport = parsed.protocol === 'https:' ? https : http;
var req = transport.request(options, function handleResponse(res) {