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

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

Open fabioespinosa opened 1 year ago

fabioespinosa commented 1 year 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 1 year 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.