mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Added proxy option to http.js
This commit is contained in:
@@ -63,6 +63,12 @@ module.exports = function httpAdapter(resolve, reject, config) {
|
|||||||
auth: auth
|
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
|
// Create the request
|
||||||
var transport = parsed.protocol === 'https:' ? https : http;
|
var transport = parsed.protocol === 'https:' ? https : http;
|
||||||
var req = transport.request(options, function handleResponse(res) {
|
var req = transport.request(options, function handleResponse(res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user