TestEngineering/Performance/Raptor/Mitmproxy: Difference between revisions

Jump to navigation Jump to search
m
Line 12: Line 12:
The following process was used to record the mitmproxy page archives (on OSX):
The following process was used to record the mitmproxy page archives (on OSX):


1. Install mitmproxy following the mitmproxy [http://docs.mitmproxy.org/en/stable/install.html installation instructions]
1. Install Mitmproxy 2.X following the mitmproxy [http://docs.mitmproxy.org/en/stable/install.html installation instructions]


2. Setup a local proxy in Firefox:
2. Setup a local proxy in Firefox:
Line 23: Line 23:
* Click the "OK" button to save the proxy settings
* Click the "OK" button to save the proxy settings


3. Install the mitmproxy CA certificate:
3. Install the Mitmproxy CA certificate:
* Open a terminal window
* Open a terminal window
* Startup mitmproxy in host mode:
* Startup Mitmproxy in host mode:
   mitmproxy --host
   mitmproxy --host
* In Firefox, browse to "mitm.it" and follow the directions on how to accept the CA certificate
* In Firefox, browse to "mitm.it" and follow the directions on how to accept the CA certificate
* Shutdown the mitmproxy tool (in terminal hit "Q", then "Y" to quit)
* Shutdown the Mitmproxy tool (in terminal hit "Q", then "Y" to quit)


4. Record a new page:
4. Record a new page:
Line 41: Line 41:
5. To test playing back your recorded page:
5. To test playing back your recorded page:
* Start Firefox with the proxy still enabled
* Start Firefox with the proxy still enabled
* With mitmproxy NOT running, browse to your recorded URL (i.e. www.spacex.com); you'll just get an error saying that the proxy server is refusing connections
* With Mitmproxy NOT running, browse to your recorded URL (i.e. www.spacex.com); you'll just get an error saying that the proxy server is refusing connections
* In a terminal window, start mitmproxy playback:
* In a terminal window, start Mitmproxy playback:
   mitmdump -k /path/to/save/recording.mp
   mitmdump -k /path/to/save/recording.mp
* In Firefox browse to the URL that you recorded already (i.e. www.spacex.com). This time the page will load successfully; it is actually loading the page from the local mitmdump archive file (*.mp) and not the external site
* In Firefox browse to the URL that you recorded already (i.e. www.spacex.com). This time the page will load successfully; it is actually loading the page from the local mitmdump archive file (*.mp) and not the external site
Confirmed users
372

edits

Navigation menu