Skip to main content

http-proxy-agent

Enable support for http_proxy, https_proxy and no_proxy env variables

Installation

You need to install @tramvai/module-http-proxy-agent

yarn add @tramvai/module-http-proxy-agent

And connect in the project

import { createApp } from '@tramvai/core';
import { HttpProxyAgentModule } from '@tramvai/module-http-proxy-agent';

createApp({
name: 'tincoin',
modules: [ HttpProxyAgentModule ],
});

Environment variables

  • HTTP_PROXY - proxy url for HTTP requests

  • http_proxy - see HTTP_PROXY

  • HTTPS_PROXY - proxy url for HTTPS requests

  • https_proxy - see HTTPS_PROXY

  • NO_PROXY - list of urls patterns for which proxying is disabled

  • no_proxy - see NO_PROXY

Explanation

HttpProxyAgentModule mokeypatch standard NodeJS https.Agent for supporting connections via forwarding proxy, if some of mentioned above env variables are presented.

Some NO_PROXY env specification and examples available here

Source code forked from node-keepalive-proxy-agent

Limitations

HttpProxyAgentModule support only HTTPS requests