From 20666942d60f92e9d79d8c266972343ca6358e13 Mon Sep 17 00:00:00 2001 From: Nick Uraltsev Date: Wed, 24 Aug 2016 15:48:14 -0700 Subject: [PATCH] Adding proxy to TypeScript definitions --- axios.d.ts | 6 ++++++ test/typescript/axios.ts | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/axios.d.ts b/axios.d.ts index 1f781a4..d672175 100644 --- a/axios.d.ts +++ b/axios.d.ts @@ -11,6 +11,11 @@ export interface AxiosBasicCredentials { password: string; } +export interface AxiosProxyConfig { + host: string; + port: number; +} + export interface AxiosRequestConfig { url?: string; method?: string; @@ -35,6 +40,7 @@ export interface AxiosRequestConfig { maxRedirects?: number; httpAgent?: any; httpsAgent?: any; + proxy?: AxiosProxyConfig; } export interface AxiosResponse { diff --git a/test/typescript/axios.ts b/test/typescript/axios.ts index 1a8a88e..9f25f1b 100644 --- a/test/typescript/axios.ts +++ b/test/typescript/axios.ts @@ -26,7 +26,11 @@ const config: AxiosRequestConfig = { onDownloadProgress: (progressEvent: any) => {}, maxContentLength: 2000, validateStatus: (status: number) => status >= 200 && status < 300, - maxRedirects: 5 + maxRedirects: 5, + proxy: { + host: '127.0.0.1', + port: 9000 + } }; const handleResponse = (response: AxiosResponse) => {