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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user