I’m trying to use mitmproxy in a Rails 4.2.8 application, and was able to
brew install mitmproxy successfully!
However, following the Certificates: Quick Setup, I’ve hit a brick wall. I’m assuming that the just start mitmproxy directive means to run the
mitmproxy command in the Terminal application. If so, I have successfully done that and see “
[0/0]” and “
How do I now: “configure your target device with the correct proxy settings”? Am I supposed to configure these settings on my Mac, in my browser, or in my Rails application? What should these settings be? Does anyone have an example they can share?
p.s. the Mac OS X link has been archived and is no longer updated by Apple. Maybe this link is a suitable replacement: https://support.apple.com/kb/PH20129?locale=en_US
Thanks for the heads-up regarding the Mac link - we’ll get that fixed. What exactly are you trying to achieve? View all requests hitting your Rails application, or see all HTTP requests made by your rails application?
I’m trying to write feature specs for my application using Authorize.Net’s Accept.js, which accepts credit card information for transactions. I think I need to see the HTTP requests and responses so that I can effectively mock/stub in my tests. Am I on the right path using mitmproxy?
In case anyone else comes across this, here are the steps I used to successfully get the proxy working for Mac + iOS. The docs really need to be updated from the current “installation left as an exercise for the reader”…
Connect Mac and iPhone on the same Wi-Fi network.
Mac: install https://docs.mitmproxy.org/stable/overview-installation/#macos.
Mac: configure https://docs.mitmproxy.org/stable/howto-transparent/#macos (note have to sudo vim /etc/sudoers and use :w!).
Mac: get IP Address by option-clicking on wifi in menu bar (eg 10.112.105.76).
Mac > Terminal: run
mitmproxy and get PORT from bottom right (eg [*:8080]).
iPhone > Settings > Wifi > tap active Wi-Fi’s (i) symbol > Configure Proxy > Manual, server = 10.112.105.76, Port = 8080 > Save.
iPhone > Safari: go to mitm.it and install the certificate.
iPhone > Settings > General > About > Certificate Trust Settings > turn “Enable Full Trust For Root Certificates” ON for mitmproxy.
P.S. there are much simpler ways of testing web app requests than using mitmproxy…