diff --git a/src/ping.ts b/src/ping.ts index 2ff2625..ce6c4c4 100644 --- a/src/ping.ts +++ b/src/ping.ts @@ -11,7 +11,11 @@ async function runPing(url: string): Promise { const start = Date.now() if (process.env.NODE_ENV !== 'test') { - await fetch(url) + if (process.env.http_proxy) { + await fetch(url, { agent:new HttpsProxyAgent(process.env.http_proxy)}) + } else { + await fetch(url) + } } return Date.now() - start