Node http-proxy / http-proxy-middleware - How do you manipulate proxy response
<p>I'm using Express 4,  and I'm using a middleware <code>http-proxy-middleware</code> ( <a href="https://github.com/chimurai/http-proxy-middleware" rel="nofollow">https://github.com/chimurai/http-proxy-middleware</a>), and having the following issues</p>

<p>In normal way, I can do the following to manupulate the response before return to the client</p>

<pre><code>app.get('/v1/users/:username', function(request, response, next) {
    var username = request.params.username;
    findUserByUsername(username, function(error, user) {
        if (error) return next(error);
        return response.render('user', user);
    });
});
</code></pre>

<p>But how do I execute custom logic if I'm using proxy, let's say I want to manipulate some of the data before response to the client?  Is there a good pattern to do that with this middleware ?</p>

<pre><code>app.use('/api', proxy({target: 'http://www.example.org', changeOrigin: true}));
</code></pre>

<p>Here is the backlink for the issue I put in github as well - <a href="https://github.com/chimurai/http-proxy-middleware/issues/97" rel="nofollow">https://github.com/chimurai/http-proxy-middleware/issues/97</a></p>

<p>Any help would be appreciated.</p>