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 18 forks source link

Is it possible to add a whitelist of domains for proxy #15

Open fabioespinosa opened 2 years ago

fabioespinosa commented 2 years ago

I can see we can provide a NO_PROXY, but can we actually provide a whitelist for the only urls that can be proxied?

Would you consider a contribution for such feature?

silverwind commented 2 years ago

What would be needed would be the ability to have negative entries in NO_PROXY:

NO_PROXY='*,!.example.com'

It would mean "don't proxy anything except example.com or its subdomains".

I don't think there's anything yet in the pseudo-standard to support it.