diff --git a/binding.js b/binding.js index 18cf50e4..ee613bd3 100644 --- a/binding.js +++ b/binding.js @@ -98,11 +98,11 @@ module.exports.download_vips = function () { } catch (err) {} }); }); - const gotOpt = {}; - if (process.env.npm_config_https_proxy) { - // Use the NPM-configured HTTPS proxy - gotOpt.agent = caw(process.env.npm_config_https_proxy); - } + const gotOpt = { + agent: caw(null, { + protocol: 'https' + }) + }; const url = distBaseUrl + tarFilename; got.stream(url, gotOpt).on('response', function (response) { if (response.statusCode !== 200) { diff --git a/docs/changelog.md b/docs/changelog.md index d11681ed..ee0e785b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -13,6 +13,10 @@ Requires libvips v8.4.2. * Simplify expression for finding vips-cpp libdir. [#656](https://github.com/lovell/sharp/pull/656) +* Allow HTTP-over-HTTPS proxy when downloading pre-compiled dependencies. + [@wangzhiwei1888](https://github.com/wangzhiwei1888) + [#679](https://github.com/lovell/sharp/issues/679) + #### v0.17.0 - 11th December 2016 * Drop support for versions of Node prior to v4.