How to use the pac-proxy-agent.protocols function in pac-proxy-agent

To help you get started, we’ve selected a few pac-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 TooTallNate / node-proxy-agent / index.js View on Github external
exports.cache = new LRU(cacheSize);

/**
 * Built-in proxy types.
 */

exports.proxies = Object.create(null);
exports.proxies.http = httpOrHttpsProxy;
exports.proxies.https = httpOrHttpsProxy;
exports.proxies.socks = SocksProxyAgent;
exports.proxies.socks4 = SocksProxyAgent;
exports.proxies.socks4a = SocksProxyAgent;
exports.proxies.socks5 = SocksProxyAgent;
exports.proxies.socks5h = SocksProxyAgent;

PacProxyAgent.protocols.forEach(function (protocol) {
  exports.proxies['pac+' + protocol] = PacProxyAgent;
});

function httpOrHttps(opts, secureEndpoint) {
  if (secureEndpoint) {
    // HTTPS
    return https.globalAgent;
  } else {
    // HTTP
    return http.globalAgent;
  }
}

function httpOrHttpsProxy(opts, secureEndpoint) {
  if (secureEndpoint) {
    // HTTPS
github qiushi123 / xiaochengxu_demos / 014云开发实现小程序支付 / cloud / pay / node_modules / proxy-agent / index.js View on Github external
exports.cache = new LRU(cacheSize);

/**
 * Built-in proxy types.
 */

exports.proxies = Object.create(null);
exports.proxies.http = httpOrHttpsProxy;
exports.proxies.https = httpOrHttpsProxy;
exports.proxies.socks = SocksProxyAgent;
exports.proxies.socks4 = SocksProxyAgent;
exports.proxies.socks4a = SocksProxyAgent;
exports.proxies.socks5 = SocksProxyAgent;
exports.proxies.socks5h = SocksProxyAgent;

PacProxyAgent.protocols.forEach(function (protocol) {
    exports.proxies['pac+' + protocol] = PacProxyAgent;
});

function httpOrHttps(opts, secureEndpoint) {
    if (secureEndpoint) {
        // HTTPS
        return https.globalAgent;
    } else {
        // HTTP
        return http.globalAgent;
    }
}

function httpOrHttpsProxy(opts, secureEndpoint) {
    if (secureEndpoint) {
        // HTTPS

pac-proxy-agent

A PAC file proxy `http.Agent` implementation for HTTP

MIT
Latest version published 3 months ago

Package Health Score

82 / 100
Full package analysis

Popular pac-proxy-agent functions