Rob--W / proxy-from-env

A Node.js library to get the proxy URL for a given URL based on standard environment variables (http_proxy, no_proxy, ...).
MIT License
52 stars 19 forks source link

add support for .npmrc noproxy #19

Open stefdev49 opened 1 year ago

stefdev49 commented 1 year ago

Add support for 'noproxy' from .npmrc (https://docs.npmjs.com/cli/v9/using-npm/config#noproxy) and have it takes precedence over no_proxy in .npmrc.

noproxy is npm's documented way of specifying non proxied hosts and domains.

ksathyanm commented 1 year ago

@Rob--W ping

ksathyanm commented 1 year ago

@Rob--W axios user here. Looking for noproxy support for npm v9. Can you please take a look at this PR?

Rob--W commented 1 year ago

I have looked into this, and it appears that no_proxy was renamed to noproxy in https://github.com/npm/cli/pull/46 in response to the feedback that the --no-proxy option was not working as expected at https://web.archive.org/web/20211028044200/https://npm.community/t/no-proxy-missing-from-npm-cli/1327.html .

I'll re-examine the addition from #9, update the library if needed + document the npm config variables as appropriate.

Rob--W commented 1 year ago

As part of maintenance, I'm going to carefully examine the set of changes, and then publish 1.2.0 or even 2.0.0.

The proposed change here has potential to cause breakage, e.g. as seen in #13 after support for npmrc was introduced in #9.

As one of the first steps, I'm going to update the CI in #20.

Due to other obligations I cannot work on this before next month (May).

ricksbrown commented 4 months ago

This PR would help with this issue: https://github.com/cypress-io/cypress/issues/19586