You can do this by overriding the write function of the response.
proxy.on('start', function(req, res, target) {
var existingWrite = res.write;
res.write = function(data) {
// cache data
// Call the base write function.
existingWrite.apply(res, arguments);
};
});
We did something similar to track and record bandwidth usage.
On Monday, August 27, 2012 2:37:39 AM UTC-4, framlin wrote:
>
> Serrvus,
>
> I use http-proxy (from nodejitsu) and want to store the result of the
> proxied response in order to cache it.
>
> How can I do this?
>
> Have a nice and peacefully day
>
> Wolfgang
>
--
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