Skip to content

Instantly share code, notes, and snippets.

@gsquaredxc
Created November 7, 2018 03:17
Show Gist options
  • Save gsquaredxc/df4ebd8a452028d8bfa5636e7f4ae298 to your computer and use it in GitHub Desktop.
Save gsquaredxc/df4ebd8a452028d8bfa5636e7f4ae298 to your computer and use it in GitHub Desktop.
problem
var myAgent = new http.Agent({
keepAlive: true,
maxSockets: 1,
keepAliveMsecs: 3000
});
request.post({url:'http://website.com/something', agent: myAgent , form: {key:'value',other:'value'}}, function(err,res,body){ /* ... */ });
request.post({url:'http://website.com/something/else', agent: myAgent , form: {test:'value',otherkey:'value'}}, function(err,res,body){ /* ... */ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment