E.g. If you have a proxy at http://localhost:8081 pointing to your Unleash API URL run your app that contains the Node SDK with: HTTP_PROXY=http://localhost:8081 node my_app.js
Design decision:
instead of using @npmcli/agent directly that does the env var detection I decided to implement detection myself and instantiate http and https proxies directly. Those are the same proxies that the @npmcli/agent instantiates. The reason I choose to do it myself is because @npmcli/agent doesn't have any TS types and we loose autocompletion. On the other hand the low level agents have built-in TS support.
coverage: 90.784% (-0.05%) from 90.834%
when pulling e000d742739421bfca6763831a0b41cefa6e8d38 on http-https-proxy-support
into 279cd2ef3bd5b2da0c647befb465705b9ca8e57b on main.
About the changes
Support for HTTP_PROXY and HTTPS_PROXY
E.g. If you have a proxy at http://localhost:8081 pointing to your Unleash API URL run your app that contains the Node SDK with:
HTTP_PROXY=http://localhost:8081 node my_app.js
Design decision:
Can be tested locally with https://github.com/kwasniew/proxy-server
Important files
Discussion points