This file contains 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 ctx | |
class Replacer: | |
def __init__(self): | |
self.num = 0 | |
def response(self, flow): | |
self.num = self.num + 1 | |
flow.response.content = flow.response.content.replace('知道'.encode(), '知道个屁'.encode()) | |
ctx.log.info(f"We've replaced {self.num} flows") | |
addons = [ | |
Replacer() | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment