Last active
July 6, 2017 04:24
-
-
Save marciorodrigues87/71e24bef9109134f4cfb9bcbe5ba87b5 to your computer and use it in GitHub Desktop.
request-config-step-one.js
This file contains hidden or 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
const Agent = require('agentkeepalive') | |
const httpsAgent = new Agent.HttpsAgent({ | |
keepAlive: true, // <-- | |
maxSockets: 100 // <-- | |
}) | |
const request = require('request-promise').defaults({ | |
resolveWithFullResponse: true, | |
agent: httpsAgent // <-- | |
}) | |
request('https://www.vivareal.com.br/') | |
.then(response => { | |
console.log('statusCode:', response && response.statusCode) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment