Skip to content

Instantly share code, notes, and snippets.

@IskenHuang
Created January 14, 2016 10:06
Show Gist options
  • Save IskenHuang/c805464b8e6c081ab27e to your computer and use it in GitHub Desktop.
Save IskenHuang/c805464b8e6c081ab27e to your computer and use it in GitHub Desktop.
mitmproxy scripts
#!/usr/bin/env python
# https://docs.mitmproxy.org/en/stable/scripting/inlinescripts.html#inline-scripts
def response(context, flow):
if 'www.taobao.com' in flow.request.host:
flow.request.host = 'www.tmall.com'
def request(context, flow):
if 'www.taobao.com' in flow.request.host:
flow.request.host = 'www.tmall.com'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment