[ Question ] How do you manipulate proxy response
See original GitHub issueHi, I’m using Express 4,
In normal way, I can do the following
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);
});
});
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 user? Is there a good pattern to do that with this middleware ?
app.use('/api', proxy({target: 'http://www.example.org', changeOrigin: true}));
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:38 (2 by maintainers)
Top Results From Across the Web
[ Question ] How do you manipulate proxy response #528
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...
Read more >node.js - How do you manipulate proxy response
I think this is the correct way to do it according to the official documentation of http-proxy. modify -response app.use('/api', proxy({ ...
Read more >How to Intercept Requests & Modify Responses With Burp Suite
It is a proxy through which you can direct all requests, and receive all responses, so that you can inspect and interrogate them...
Read more >Mocking And Manipulating API Behavior With A Local Proxy ...
We want the API to respond with unusual responses like different HTTP status codes or specially crafted but valid values. The proxy should...
Read more >Membrane Service Proxy FAQ
Q : Can Membrane manipulate intercepted request and response message? A: Membrane is made to be used for such tasks as intercepting and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
here is my answer,
add onProxyRes option on the http-proxy-middleware use the data event on the proxyRes to get the output then modify the output in res.write
My solution: