Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
aws-sdk-v3-proxy
Advanced tools
A wrapper for adding proxy support to AWS SDK v3 clients
This wrapper adds a proxy configuration to AWS SDK clients by checking environment
variables and attaching the necessary request handler. By default, an error will
be thrown if no proxy is found in process.env
, but also has options to not throw
which can be useful when developing other node utilities using this library.
Note: http_proxy
and HTTP_PROXY
take precedence over https_proxy
and HTTPS_PROXY
.
If you would like to change this behavior it can be specified in the options.
npm install aws-sdk-v3-proxy
// process.env.HTTP_PROXY = 'http://127.0.0.1'
import { S3Client } from '@aws-sdk/client-s3';
import { addProxyToClient } from 'aws-sdk-v3-proxy';
const client = addProxyToClient(new S3Client({}));
// `client` now has HTTP proxy config at 'http://127.0.0.1'
or
import { S3Client } from '@aws-sdk/client-s3';
import { addProxyToClient } from 'aws-sdk-v3-proxy';
const client = addProxyToClient(new S3Client({}), {
httpProxy: 'http://127.0.0.1',
});
// `client` now has HTTP proxy config at 'http://127.0.0.1'
// process.env.HTTPS_PROXY = 'https://127.0.0.1'
import { S3Client } from '@aws-sdk/client-s3';
import { addProxyToClient } from 'aws-sdk-v3-proxy';
const client = addProxyToClient(new S3Client({}));
// `client` now has HTTPS proxy config at 'https://127.0.0.1'
or
import { S3Client } from '@aws-sdk/client-s3';
import { addProxyToClient } from 'aws-sdk-v3-proxy';
const client = addProxyToClient(new S3Client({}), {
httpsProxy: 'https://127.0.0.1',
});
// `client` now has HTTPS proxy config at 'https://127.0.0.1'
// process.env.HTTPS_PROXY = undefined
// process.env.HTTP_PROXY = undefined
import { S3Client } from '@aws-sdk/client-s3';
import { addProxyToClient } from 'aws-sdk-v3-proxy';
const client = addProxyToClient(new S3Client({}), { throwOnNoProxy: false });
// `client` has no proxy assigned and no error thrown
// process.env.HTTPS_PROXY = 'https://127.0.0.1'
import { readFileSync } from 'fs';
import { S3Client } from '@aws-sdk/client-s3';
import { addProxyToClient } from 'aws-sdk-v3-proxy';
const client = addProxyToClient(new S3Client({}), {
agentOptions: {
ca: [readFileSync('custom-proxy-cert.pem').toString()],
},
});
// `client` now has HTTPS proxy config at 'https://127.0.0.1' with ca `custom-proxy-cert.pem`
Type: Object
Any client from @aws-sdk.
Type: object
Type: boolean
Default: true
Throw an error if no proxy is found in the environment.
Type: boolean
Default: false
Can be specified in cases where you have both http_proxy and https_proxy set, and would like to override the default behavior of the http_proxy taking precedence.
Type: boolean
Default: false
Toggles additional logging for debugging.
Type: string
The URL for the HTTP proxy server.
If not specified, the value of process.env.http_proxy
or process.env.HTTP_RPOXY
will be used.
The URL for the HTTPS proxy server.
If not specified, the value of process.env.https_proxy
or process.env.HTTPS_RPOXY
will be used.
Type: HttpsProxyAgentOptions
Used to pass specific options to the proxy agent.
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.
FAQs
A wrapper for adding proxy support to AWS SDK v3 clients
The npm package aws-sdk-v3-proxy receives a total of 3,557 weekly downloads. As such, aws-sdk-v3-proxy popularity was classified as popular.
We found that aws-sdk-v3-proxy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.