UNPKG

@warren-bank/node-request-cli

Version:

An extremely lightweight HTTP request client for the command-line. Supports: http, https, proxy, redirects, cookies, content-encoding, multipart/form-data, multi-threading, recursive website crawling and mirroring.

15 lines (11 loc) 471 B
const addProxyAgent = (argv_vals, options) => { if ((options instanceof Object) && options.protocol) { const is_http = (options.protocol.toLowerCase() === 'http:') const is_https = (options.protocol.toLowerCase() === 'https:') if (is_http && argv_vals["--proxy-http"]) options.agent = argv_vals["--proxy-http"] if (is_https && argv_vals["--proxy-https"]) options.agent = argv_vals["--proxy-https"] } } module.exports = {addProxyAgent}