How to use the proxy-agent.default function in proxy-agent

To help you get started, we’ve selected a few proxy-agent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zotoio / github-task-manager / src / agent / AgentMetrics.js View on Github external
const EVENTS_TABLE = process.env.GTM_DYNAMO_TABLE_EVENTS;
let INITIAL_DATA = [];
let EventMetricStream;

let elastic;
if (process.env.GTM_ELASTIC_HOST && process.env.GTM_ELASTIC_PORT) {
    elastic = new elasticsearch.Client({
        host: `${process.env.GTM_ELASTIC_HOST}:${process.env.GTM_ELASTIC_PORT}`,
        log: 'info'
    });
}

if (process.env.IAM_ENABLED) {
    AWS.config.update({
        httpOptions: {
            agent: proxy(process.env.HTTP_PROXY)
        }
    });
}

async function configureRoutes(app) {
    let ddb;
    if (process.env.GTM_DYNAMO_VPCE) {
        console.log('Configuring DynamoDB to use VPC Endpoint');
        ddb = new AWS.DynamoDB({
            httpOptions: {
                agent: new https.Agent()
            }
        });
    } else {
        console.log('Configuring DynamoDB to use Global AWS Config');
        ddb = new AWS.DynamoDB();
github zotoio / github-task-manager / src / agent / AgentLogger.js View on Github external
function create(agentId) {
    if (!agentId) console.warn('agentId is not set.');

    let CWLogOptions = {
        region: process.env.GTM_AWS_REGION
    };

    if (process.env.IAM_ENABLED) {
        CWLogOptions = {
            region: process.env.GTM_AWS_REGION,
            //accessKeyId: process.env.AWS_ACCESS_KEY_ID,
            //secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
            //sessionToken: process.env.AWS_SECURITY_TOKEN,
            httpOptions: {
                agent: proxy(process.env.HTTP_PROXY)
            }
        };
    }

    let cloudWatchStream = new CWLogsWritable({
        logGroupName: getLogGroupMap()['gtmAgent'],
        logStreamName: 'AGENT_ID=' + agentId,
        cloudWatchLogsOptions: CWLogOptions
    }).on('error', console.error);

    janitorInterval = setInterval(streamJanitor, 60000);

    let bunyanConf = {
        name: agentId.substring(0, 7),
        streams: [
            {

proxy-agent

Maps proxy protocols to `http.Agent` implementations

MIT
Latest version published 9 months ago

Package Health Score

82 / 100
Full package analysis

Popular proxy-agent functions