mitmproxy to setup http(s) for HTTP(s) Testing

Just used mitmproxy to test a new server. The purpose of the testing is, we are using a new server however before we switch to the new server we have to test it. Use mitmproxy to configure the proxy and then in the proxy host remap the server host with new ip in /etc/hosts.

https://www.jianshu.com/p/0cc558a8d6a2

Basic steps:

  1. install mitmproxy
  2. ensure all devices are connecting to the same network (say the same wifi network)
  3. ./mitmproxy –mode regular –listen-host your_host_ip
    1. huanglh-temp:mitmproxy-4.0.4-osx huanglh$ pwd
      /Users/huanglh/Downloads/mitmproxy-4.0.4-osx
      huanglh-temp:mitmproxy-4.0.4-osx huanglh$ ./mitmproxy –mode regular –listen-host 10.2.64.251
  4. in your_host machine, update the new ip-server pairs in /etc/hosts
  5. in the clients, configure proxy to points to your_host_ip
  6. visit http://mitm.it/ to install cert from your clients
  7. Monitor the http(s) from your_host
  8. Done