Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
README.md: Mention proxy-from-env support (#56)
Browse files Browse the repository at this point in the history
This makes using this library correctly & robustly far easier.
  • Loading branch information
nhooyr committed Dec 18, 2020
1 parent b9fcf37 commit f4d6ff6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ proxy-agent
[![Build Status](https://travis-ci.org/TooTallNate/node-proxy-agent.svg?branch=master)](https://travis-ci.org/TooTallNate/node-proxy-agent)

This module provides a function that returns proxying `http.Agent` instances to
use based off of a given proxy URI.
use based off of a given proxy URI. If no URI is provided, then
[proxy-from-env](https://www.npmjs.com/package/proxy-from-env) is used to get the URI
from `$HTTP_PROXY`, `$HTTPS_PROXY` and `$NO_PROXY` among others.

An LRU cache is used so that `http.Agent` instances are transparently re-used for
subsequent HTTP requests to the same proxy server.
Expand Down Expand Up @@ -47,6 +49,8 @@ var opts = {
host: 'jsonip.org',
path: '/',
// this is the important part!
// If no proxyUri is specified, then https://www.npmjs.com/package/proxy-from-env
// is used to get the proxyUri.
agent: new ProxyAgent(proxyUri)
};

Expand Down

0 comments on commit f4d6ff6

Please sign in to comment.