Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

thib3113/axios-proxy-tunnel

Repository files navigation

AXIOS-PROXY-TUNNEL

styled with prettier Greenkeeper badge Travis Coveralls Dev Dependencies

Create HTTPS tunnel through HTTP proxies (like corporate proxies)

Here is an example :

import axios from 'axios';
import axiosProxyTunnel from 'axios-proxy-tunnel';

const myInstance = axiosProxyTunnel(axios.create());

And if you use an HTTP proxy (by setting proxy configuration, or by using environment vars), the package will change the httpsAgent, to use a tunnel .

Internally, this library use interceptors, if you want to change configuration with interceptors too, please use like this :

import axios from 'axios';
import axiosProxyTunnel from 'axios-proxy-tunnel';

const myInstance = axios.create();

//all you want to do with your instance

axiosProxyTunnel(myInstance);

For the moment, this library is just adapted to my needs, and maybe not ready in your cases . If you have ideas/problems, please create issue/PR