2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Adding proxy to TypeScript definitions

This commit is contained in:
Nick Uraltsev
2016-08-24 15:48:14 -07:00
parent 65ffdaefe8
commit 20666942d6
2 changed files with 11 additions and 1 deletions
Vendored
+6
View File
@@ -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 {
+5 -1
View File
@@ -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) => {