Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for HTTPS proxy configurations #919

Open
stevejpurves opened this issue Feb 20, 2024 · 0 comments
Open

Support for HTTPS proxy configurations #919

stevejpurves opened this issue Feb 20, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@stevejpurves
Copy link
Contributor

It is not possible to use the CLI on networks that enforce a strict proxy policy for internet access.

Proposal

Enable proxy based access through by using the https-proxy-agent middleware with node-fetch and allowing users to specify their proxy configuration string via an environment variable HTTPS_PROXY.

We'd need to ensure that all fetch calls receive the proxy configuration, so could consider an extension to the session object to provide easy access to an appropriately configured call to fetch.

Additional notes

e.g.

const fetch = require('node-fetch');
const HttpsProxyAgent = require('https-proxy-agent');
const Http = require('https');

const url = "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png";
const proxyUrl = process.env.HTTPS_PROXY;

const options = {
    agent: HttpsProxyAgent(proxyUrl)
};

const response = await fetch(url, options);
@stevejpurves stevejpurves added the enhancement New feature or request label Feb 20, 2024
@fwkoch fwkoch self-assigned this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants