Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 3, 2024 via pnpm

proxy-from-env 1.1.0

Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.
Package summary
Share
0
issues
1
license
1
MIT
Package created
18 Feb 2016
Version published
4 Mar 2020
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
proxy-from-env@1.1.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of proxy-from-env 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does proxy-from-env do?

Proxy-from-env is a Node.js package that provides a function known as getProxyForUrl. This function accepts a URL as input and returns the respective proxy URL, following the Environment Variables such as *_PROXY (example, HTTP_PROXY) and NO_PROXY. In instances where no proxy is defined, the function will return an empty string. It should be noted that 'proxy-from-env' identifies the proxy, but the actual task of proxying the request is handled by the incorporating program.

How do you use proxy-from-env?

To use proxy-from-env, first install it via npm usnig the command npm install proxy-from-env. The function getProxyForUrl is then imported from the proxy-from-env package. This function can be used to identify the proxy for a specific URL. Here's an example:

var getProxyForUrl = require('proxy-from-env').getProxyForUrl;
var some_url = 'http://example.com/something';

var proxy_url = getProxyForUrl(some_url);  // Obtain the proxy URL

if (proxy_url) {
  // Process the request via the proxy_url
  // The rest of the processing code goes here
}

In this code snippet, getProxyForUrl is used to determine the proxy for the some_url. If a proxy is defined, then the relevant processing can be done via this proxy.

Where are the proxy-from-env docs?

As for the documentation of proxy-from-env, it is located within the README file of the GitHub repository. You can access it via the following URL: https://github.com/Rob--W/proxy-from-env. This documentation explains in detail how the package works, how to specify environment variables for proxy settings, and provides examples on how to use the package.