On Sat, Dec 15, 2012 at 7:24 PM, David Lozano <[email protected]> wrote:
> Hi,
>
> To have connection reuse when making http requests, I'd like to use the
> ForeverAgent without having to use the whole request module. My idea is to
> use it instead of the http.globalAgent when making http.request.
>
> Is that possible? Can someone tell me how to do that?
>
> I'm using node v0.8.15
>
> Thanks!
If ForevererAgent derives from or quacks like a http.Agent, you can
pass an instance to http.request():
var agent = new ForeverAgent(...);
var options = { agent: agent, ... };
var req = http.request(options, ...);
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en