Giter Site home page Giter Site logo

aws-sdk-with-proxy's Introduction

This (very) simple module just adds the proxy-agent package to the AWS SDK by default, so you don't forget to add it every time you import aws-sdk. This means environment variables like HTTPS_PROXY, HTTP_PROXY and NO_PROXY will work by default.

It'll use any version of the SDK, so ensure the version you care about is in package.json and all should be good.

This will probably rely on this PR being accepted before it'll properly gather information from environment variables, hence why I haven't bothered to upload this to NPM yet.

Note that in 99% of cases, if you use this library you'll probably want to add NO_PROXY=169.254.169.254,169.254.170.2 to your environment variables, otherwise it'll try to proxy requests to the metadata/task endpoints through your proxy, which isn't normally what you want.

If you'd rather pass the proxy information to proxy-agent instead of using env vars, then you probably just want to add this snippet every time you import AWS as it achieves the same thing:

const AWS = require('aws-sdk');
AWS.config.update({httpOptions:{agent:require('proxy-agent')("http://yourproxy:8080")}});

Installation

Not yet uploaded to NPM, but when it is, you'll be able to:

npm install aws-sdk aws-sdk-with-proxy
# or
yarn add aws-sdk aws-sdk-with-proxy

Usage

const AWS = require('aws-sdk-with-proxy');
//Bam, magic, AWS requests will go through your proxy as configured by your env vars, or it won't if they aren't set. Remember to add this to your env vars:
// NO_PROXY=169.254.169.254,169.254.170.2

aws-sdk-with-proxy's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.