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

Commit f4d6ff6

Browse files
authored
README.md: Mention proxy-from-env support (#56)
This makes using this library correctly & robustly far easier.
1 parent b9fcf37 commit f4d6ff6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ proxy-agent
44
[![Build Status](https://travis-ci.org/TooTallNate/node-proxy-agent.svg?branch=master)](https://travis-ci.org/TooTallNate/node-proxy-agent)
55

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

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

0 commit comments

Comments
 (0)