Last active
September 20, 2019 08:49
-
-
Save zhgchgli0718/cfe95541f4f250d187c11bcb22b38ed8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mitmproxy import http | |
def request(flow: http.HTTPFlow) -> None: | |
# pretty_host takes the "Host" header of the request into account, | |
# which is useful in transparent mode where we usually only have the IP | |
# otherwise. | |
flow.request.headers['User-Agent'] = 'MitmProxy' | |
if flow.request.pretty_host == "123.com.tw": | |
flow.request.host = "456.com.tw" | |
# 將123.com.tw的訪問全導到456.com.tw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment