
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
get-url-proxy
Advanced tools
get-url-proxy will return the applicable proxy to use for a given URL based on NO_PROXY and PROT_PROXY environment variables
get-url-proxy will return the applicable proxy to use for a given URL based on NO_PROXY and {PROTOCOL}_PROXY environment variables.
console.log(process.env.HTTP_PROXY) // "http://proxy:8080/"
console.log(process.env.NO_PROXY); // ".foo.com,192.168.1."
// requires protocol & domain
var getProxy = require('get-url-proxy');
getProxy('http://foo.com/'); // null
noProxy('https://www.google.com/'); // "http://proxy:8080/"
// the cached wrapper will cache the last 100 resources
var cachedProxy = require('get-url-proxy/cached');
// protocol only, without NO_PROXY check
var protocolProxy = require('get-url-proxy/protocol');
protocolProxy('https'): // "http://proxy:8080/"
The following search order will be used, generally speaking...
NO_PROXY exclusion will return nullPROTOCOL_PROXYprotocol_proxyALL_PROXYall_proxynull will be returned with no match.For web based protocols, additional/similar protocols will be searched as a fallback.
HTTP -> [HTTP, HTTPS]HTTPS -> [HTTPS, HTTP]WS -> [WS, WSS, HTTPS, HTTP]WSS -> [WSS, WS, HTTPS, HTTP]SFTP -> [SFTP, SSH]All other protocols will only search for their own protocol specifically, falling back to ALL_PROXY
If you are using a node version prior to Node 8, you should install url-parse as a dependency.
FAQs
get-url-proxy will return the applicable proxy to use for a given URL based on NO_PROXY and PROT_PROXY environment variables
The npm package get-url-proxy receives a total of 7 weekly downloads. As such, get-url-proxy popularity was classified as not popular.
We found that get-url-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.