How to use the https-proxy-agent.default function in https-proxy-agent

To help you get started, we’ve selected a few https-proxy-agent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jspm / jspm-cli / lib / install / fetch.js View on Github external
}
        if (common_1.hasProperties(agentOptions) && url.startsWith('https:')) {
            let existingAgents;
            if (credentials.proxy)
                existingAgents = proxyAgents.get(credentials.proxy);
            else
                existingAgents = agents;
            if (existingAgents)
                agent = agents.find(agent => {
                    return !Object.keys(agentOptions).some(opt => agent.options[opt] !== agentOptions[opt]);
                });
            if (!agent) {
                if (credentials.proxy) {
                    if (!existingAgents)
                        proxyAgents.set(credentials.proxy, existingAgents = []);
                    existingAgents.push(agent = new https_proxy_agent_1.default(Object.assign({}, credentials.proxy)));
                }
                else {
                    agents.push(agent = (new https_1.Agent(agentOptions)));
                }
            }
        }
        this.debugLog(`${method} ${url}${writeCredentialLog(credentials)}`);
        if (credentials.basicAuth) {
            const urlObj = new url_1.URL(url);
            if (!urlObj.username && !urlObj.password) {
                ({ username: urlObj.username, password: urlObj.password } = credentials.basicAuth);
                requestUrl = urlObj.href;
            }
        }
        if (agent)
            options = Object.assign({ agent }, options);

https-proxy-agent

An HTTP(s) proxy `http.Agent` implementation for HTTPS

MIT
Latest version published 3 months ago

Package Health Score

85 / 100
Full package analysis

Popular https-proxy-agent functions