silverwolf-x/project / packages /font /src /google /get-proxy-agent.ts
silverwolf-x's picture
download
raw
620 Bytes
// @ts-ignore
import HttpsProxyAgent from 'next/dist/compiled/https-proxy-agent'
// @ts-ignore
import HttpProxyAgent from 'next/dist/compiled/http-proxy-agent'
import type { Agent } from 'https'
/**
* If the http(s)_proxy environment variables is set, return a proxy agent.
*/
export function getProxyAgent(): Agent | undefined {
const httpsProxy = process.env['https_proxy'] || process.env['HTTPS_PROXY']
if (httpsProxy) {
return new HttpsProxyAgent(httpsProxy)
}
const httpProxy = process.env['http_proxy'] || process.env['HTTP_PROXY']
if (httpProxy) {
return new HttpProxyAgent(httpProxy)
}
}

Xet Storage Details

Size:
620 Bytes
·
Xet hash:
8fda63fdae2ff3ddec933d6b5dad4e0f56a92c8d6d743881a5d8b3df4f5dd026

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.