Added Proxy Options

This commit is contained in:
killer069
2021-09-27 23:12:22 +05:30
parent 098376db38
commit f21f34ea31
2 changed files with 17 additions and 6 deletions

View File

@@ -2,9 +2,19 @@ import https, { RequestOptions } from 'https';
import { IncomingMessage } from 'http';
import { URL } from 'url';
interface ProxyOpts {
host : string,
port : number,
authentication? : {
username : string;
password : string;
}
}
interface RequestOpts extends RequestOptions {
body?: string;
method?: 'GET' | 'POST';
proxies? : string[] | ProxyOpts[]
}
function https_getter(req_url: string, options: RequestOpts = {}): Promise<IncomingMessage> {