Skip to content

italankin/mitmproxy-addons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mitmproxy-addons

Some addons which can be used for developing and testing client-server applications.

Usage

Run mitmproxy with one or more addons:

$ mitmproxy \
    -s replayserverex.py \
    -s sleeper.py

Or while running:

: set scripts=replayserverex.py

Or via config.yaml:

scripts: [
    '~/mitmproxy-addons/offline.py',
    '~/mitmproxy-addons/sleeper.py'
]

Addons

Extensions for built in ServerPlayback addon.

Commands:

  • replay.server.file.add - add flows to server playback from file
  • replay.server.list - show server playback buffer

This addon allows to add a filter and for any flow matching it status code and contents of the response will be replaced.

For example, to replace any response from google.com with a status code of 200 and contents from response.json:

: replay.server.matchers.add google.com 200 response.json

Commands:

  • replay.server.matchers.add - add a matcher for server playback
  • replay.server.matchers.clear - clear all matchers
  • replay.server.matchers.list - show matchers list

Adds a delay before sending a request.

Options:

  • sleep - delay client requests by this amount of time (milliseconds)
  • sleep_filter - delay only flows which match the filter

Simulate offline mode by killing all (or matching a filter) requests.

Options:

  • offline - kill all flows
  • offline_filter - kill only flows matching the filter