Skip to content

Instantly share code, notes, and snippets.

@flankerhqd
Last active December 17, 2016 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flankerhqd/df6f6144c7c395d9b6f047dc2ecc2683 to your computer and use it in GitHub Desktop.
Save flankerhqd/df6f6144c7c395d9b6f047dc2ecc2683 to your computer and use it in GitHub Desktop.
sample script for github issue
import mitmproxy
from mitmproxy.models import HTTPResponse
from netlib.http import Headers
import os
def request(context, flow):
print flow.request.url
if not flow.request.url.endswith("test.html"):
return
print "fuck"
resp = HTTPResponse([1,1], 302, "Found", ODictCaseless([["Context-Type", "text/html"], ["Location", "http://192.168.12.1/aaa.html"]]), "")
flow.reply(resp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment