lib: Match proxy support with request
module #1978
Closed
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Checklist
npm install && npm test
passesDescription of change
Per #1176 (comment), closes #1751
When using the
no_proxy
environmental variable I noticed that some installations would fail whenNODE_CONFIG_PROXY
was set (or its equivalent). From inspecting this code plus how its dependency, https://github.com/request/request, I noticed it already has full proxy support. Changing env itself might lead to side effects.--proxy
to blockingno_proxy
from https://github.com/request/request/blob/212570b6971a732b8dd9f3c73354bcdda158a737/request.js#L276-L278no_proxy
support through CLI--noproxy
or equivalent NPM alternatives.proxy
effectively blockshttps_proxy
currently, this also unblocks that variable (which would override ourproxy
variable). However I am mirroring thehttp_proxy
andhttps_proxy
definitions and then letting the dependency to pick either. (Implemention downstream in: https://github.com/request/request/blob/212570b6971a732b8dd9f3c73354bcdda158a737/lib/getProxyFromURI.js#L40)