lundi 20 avril 2015

npm with nonProxyHost



I've searched over the internet what is the correct way to setup npm when you need to have some sites accessed over the proxy and some without, but haven't found an answer.

To give you example, we are having npm registry mirror within our corporate infrastructure and have to therefore access it without proxy setting. On the other hand, some npm modules are accessing public urls on their own, especially in case they need to download few things, and therefore need proxy set. Very good example is the phantomjs binary.
So having npm setup with proxy option and registry pointing to our internal infrastructure is not possible now, because when proxy is set, then all urls (even registry one) are resolved thru proxy server.

So I would need something similar like Java has:
-Dhttp.proxyHost="gate.company.com" -Dhttp.proxyPort=1234 -Dhttp.nonProxyHosts=10.\|.company.com"

Is it possible with npm?

I've checked the npm config, but there are just 'proxy' and 'https-proxy' settings, but nothing in direction I require.

Thnx for answers.

Aucun commentaire:

Enregistrer un commentaire