Skip to content

Instantly share code, notes, and snippets.

@marciorodrigues87
Created July 6, 2017 04:07
Show Gist options
  • Save marciorodrigues87/bc26f32a1ca13911dd78bce7d97fe0d5 to your computer and use it in GitHub Desktop.
Save marciorodrigues87/bc26f32a1ca13911dd78bce7d97fe0d5 to your computer and use it in GitHub Desktop.
request-config-step-ten.js
const Agent = require('agentkeepalive')
const httpsAgent = new Agent.HttpsAgent({
keepAlive: true,
maxSockets: 100,
socketActiveTTL: 30 * 60 * 1000
})
const request = require('request-promise').defaults({
resolveWithFullResponse: true,
agent: httpsAgent,
gzip: true,
timeout: 1000,
auth: {
'user': 'user',
'password': 'password',
'sendImmediately': true
},
headers: {
'User-Agent': 'Aplicacao-VivaReal-v1.0.2'
}
})
require('request-debug')(request) // <--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment