How to use the tunnel-agent.httpOverHttps function in tunnel-agent

To help you get started, we’ve selected a few tunnel-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 wuchangming / node-mitmproxy / src / common / util.js View on Github external
return httpsOverHttpsAgent
        }
    } else {
        if (protocol === 'http:') {
            // if (!httpOverHttpAgent) {
            //     httpOverHttpAgent = tunnelAgent.httpOverHttp({
            //         proxy: {
            //             host: hostname,
            //             port: port
            //         }
            //     });
            // }
            return false
        } else {
            if (!httpOverHttpsAgent) {
                httpOverHttpsAgent = tunnelAgent.httpOverHttps({
                    proxy: {
                        host: hostname,
                        port: port
                    }
                });
            }
            return httpOverHttpsAgent
        }
    }
}
github cnpm / cnpmjs.org / common / urllib.js View on Github external
var urlinfo = urlparse(config.httpProxy);
  if (urlinfo.protocol === 'http:') {
    httpAgent = tunnel.httpOverHttp({
      proxy: {
        host: urlinfo.hostname,
        port: urlinfo.port
      }
    });
    httpsAgent = tunnel.httpsOverHttp({
      proxy: {
        host: urlinfo.hostname,
        port: urlinfo.port
      }
    });
  } else if (urlinfo.protocol === 'https:') {
    httpAgent = tunnel.httpOverHttps({
      proxy: {
        host: urlinfo.hostname,
        port: urlinfo.port
      }
    });
    httpsAgent = tunnel.httpsOverHttps({
      proxy: {
        host: urlinfo.hostname,
        port: urlinfo.port
      }
    });
  } else {
    throw new TypeError('httpProxy format error: ' + config.httpProxy);
  }
} else {
  httpAgent = new HttpAgent({

tunnel-agent

HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.

Apache-2.0
Latest version published 6 years ago

Package Health Score

71 / 100
Full package analysis

Similar packages