🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

proxy-from-env

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-from-env

Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.

1.1.0
latest
Version published
Weekly downloads
49M
-2.36%
Maintainers
1
Weekly downloads
 
Created

What is proxy-from-env?

The proxy-from-env npm package is a utility for determining the proxy server to use for HTTP or HTTPS requests, based on environment variables. It interprets standard proxy environment variables like HTTP_PROXY, HTTPS_PROXY, and NO_PROXY, and provides a simple API to retrieve the correct proxy based on a given URL.

What are proxy-from-env's main functionalities?

Get proxy for URL

This feature allows you to determine the appropriate proxy for a given URL by considering the environment variables. The function `getProxyForUrl` returns the URL of the proxy server that should be used for the provided URL.

const getProxyForUrl = require('proxy-from-env').getProxyForUrl;
const url = 'http://example.com';
const proxy = getProxyForUrl(url);
console.log(proxy);

Other packages similar to proxy-from-env

FAQs

Package last updated on 04 Mar 2020

Did you know?

Socket

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.

Install

Related posts