Is there any support for upstream proxy?
Hi, is there a configuration i should use when using this behind corporate proxy?
If you are using node 12 or above, you can use https://github.com/gajus/global-agent by setting an environment variable:
export GLOBAL_AGENT_HTTP_PROXY=http://corp.proxy:8080
Code sample:
require('global-agent/bootstrap');
const Proxy = require('http-mitm-proxy');
const proxy = Proxy();
proxy.listen({ port: 8081 });
could you add a context function or per request to set the proxy? because for example, we choose the proxy based on the destination URL, now we are putting all de login onRequest, and making the request via Axios, maybe is better to incorporate this feature into the proxy. Thanks.
This seems like a better solution to me because you don't patch you global agent and can still make non-proxied requests elsewhere in your node app.