This plugin will take effect only in local env. Because it overrides the agent and httpsAgent of httpclient, so it will work for every request. And also you can delegate HTTPS requests via HTTP.
http_proxy or HTTP_PROXY environment variable will be used if set in Bash. Or you can specify it when you start app:
$ http_proxy=http://127.0.0.1:8888 node index.js
Capturing HTTPS Traffic
By default the http_proxy(or HTTP_PROXY) mentioned above will be passed to httpsAgent of urllib, and rejectUnauthorized = false will be set.
However, when using self-signed certificate we need to configure the certificate, shown as follows:
ca String | Buffer | Array - An array of strings or Buffers of trusted certificates. If this is omitted several well known “root” CAs will be used, like VeriSign. These are used to authorize connections. Notes: This is necessary only if the server uses the self-signed certificate
egg-development-proxyagent
Nowadays lots of services are built upon HTTP protocol. So it’s quite common to invoke backend services based on HTTP.
There is a built-in httpclient in Egg framework so that we can use it to invoke HTTP services easily.
This plugin provides a way of capturing HTTP request for debugging purpose.
DEPRECATED
This plugin is deprecated, instead, you just need to add below code to
config.local.jsthen start your application by:
Install
Usage
This plugin will take effect only in
localenv. Because it overrides theagentandhttpsAgentof httpclient, so it will work for every request. And also you can delegate HTTPS requests via HTTP.http_proxyorHTTP_PROXYenvironment variable will be used if set in Bash. Or you can specify it when you start app:Capturing HTTPS Traffic
By default the
http_proxy(orHTTP_PROXY) mentioned above will be passed tohttpsAgentof urllib, andrejectUnauthorized = falsewill be set.However, when using self-signed certificate we need to configure the certificate, shown as follows:
Capturing Tool
Note: Capturing tool is not in this plugin, you can use one of them below:
Screenshot:
Questions & Suggestions
Please open an issue here.
License
MIT