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 PROXY_SELECTOR support #23

Closed thomasmey closed 4 months ago

thomasmey commented 4 months ago

Instead of set an proxy server unconditionally via *_PROXY environment variables and exclude certain host names via NO_PROXY environment variable, let's reverse the semantic by defining a new environment variable PROXY_SELECTOR which points to an executable that is passed a URI as first argument and will return on stdout line by line a proxy eligible for the input argument.

This will enable a more flexible proxy configuration in complex setups and by reversing the semantic, allow explicit proxy configuration of only know URIs.