Last active
February 24, 2021 11:11
-
-
Save hinst/0d75224e50bcaf70633df26a10c0aa7e to your computer and use it in GitHub Desktop.
agent for node-fetch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'http'; | |
import https from 'https'; | |
const httpAgent = new http.Agent({ keepAlive: true }); | |
const httpsAgent = new https.Agent({ keepAlive: true }); | |
const agent = (_parsedURL: URL) => _parsedURL.protocol == 'https:' ? httpsAgent : httpAgent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment