Skip to content

Instantly share code, notes, and snippets.

@marciorodrigues87
Last active July 6, 2017 04:24
Show Gist options
  • Save marciorodrigues87/71e24bef9109134f4cfb9bcbe5ba87b5 to your computer and use it in GitHub Desktop.
Save marciorodrigues87/71e24bef9109134f4cfb9bcbe5ba87b5 to your computer and use it in GitHub Desktop.
request-config-step-one.js
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