Skip to content

Instantly share code, notes, and snippets.

@hSATAC
Created August 9, 2012 03:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hSATAC/3300699 to your computer and use it in GitHub Desktop.
Save hSATAC/3300699 to your computer and use it in GitHub Desktop.
How to modify http request host and port using mitmproxy script
def request(context, flow):
if "miiicasa.com" in flow.request.host:
if flow.request.scheme == "https":
flow.request.host = "192.168.254.9"
flow.request.port = "50113"
if flow.request.scheme == "http":
flow.request.host = "192.168.254.9"
flow.request.port = "50110"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment