From ab2eafae93ea5140cee71f3902ff7132830acfd6 Mon Sep 17 00:00:00 2001 From: Aditya Manohar Date: Mon, 8 Dec 2014 12:44:39 -0800 Subject: [PATCH 1/2] Revise proxy configuration docs --- doc-src/guide/node-configuring.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/doc-src/guide/node-configuring.md b/doc-src/guide/node-configuring.md index 1e64e7ae83..6fad8f571a 100644 --- a/doc-src/guide/node-configuring.md +++ b/doc-src/guide/node-configuring.md @@ -238,14 +238,23 @@ AWS.config.apiVersion = '2012-05-04'; ### Configuring a Proxy If you cannot connect to the internet directly, the SDK supports the use of -HTTP or HTTPS proxies through global or per-service configuration options. To -set a proxy, pass the `proxy` option to the `httpOptions` setting of your -config object. This is how you could set a global proxy: +HTTP or HTTPS proxies through the use of a third party HTTP agent like +[proxy-agent](https://github.com/TooTallNate/node-proxy-agent). +##### Installation ```javascript +npm install proxy-agent --save +``` +##### In your code + +```javascript +var proxy = require('proxy-agent'); +var proxyURI = process.env.http_proxy || 'http://internal.proxy.com' +var proxyAgent = proxy(proxyURI); + AWS.config.update({ - httpOptions: { - proxy: 'http://localhost:8080' + httpOptions : { + agent: proxyAgent } }); From fb6f8043bcaa8b2de95c992ac0ea3f63a0bea20e Mon Sep 17 00:00:00 2001 From: Aditya Manohar Date: Tue, 9 Dec 2014 14:49:21 -0800 Subject: [PATCH 2/2] Revise proxy configuration docs --- doc-src/guide/node-configuring.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc-src/guide/node-configuring.md b/doc-src/guide/node-configuring.md index 6fad8f571a..03474becfe 100644 --- a/doc-src/guide/node-configuring.md +++ b/doc-src/guide/node-configuring.md @@ -238,24 +238,23 @@ AWS.config.apiVersion = '2012-05-04'; ### Configuring a Proxy If you cannot connect to the internet directly, the SDK supports the use of -HTTP or HTTPS proxies through the use of a third party HTTP agent like -[proxy-agent](https://github.com/TooTallNate/node-proxy-agent). +HTTP or HTTPS proxies through the use of a third party HTTP agent such as +[proxy-agent](https://github.com/TooTallNate/node-proxy-agent). You can visit +[npmjs.org](http://npmjs.org) for a list of other proxy libraries. ##### Installation + ```javascript npm install proxy-agent --save ``` + ##### In your code ```javascript var proxy = require('proxy-agent'); -var proxyURI = process.env.http_proxy || 'http://internal.proxy.com' -var proxyAgent = proxy(proxyURI); AWS.config.update({ - httpOptions : { - agent: proxyAgent - } + httpOptions: { agent: proxy('http://internal.proxy.com') } }); var s3 = new AWS.S3();