mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
18 lines
394 B
Python
18 lines
394 B
Python
|
import argparse
|
||
|
|
||
|
|
||
|
class Replacer:
|
||
|
def __init__(self, src, dst):
|
||
|
self.src, self.dst = src, dst
|
||
|
|
||
|
def response(self, flow):
|
||
|
flow.response.replace(self.src, self.dst)
|
||
|
|
||
|
|
||
|
def start():
|
||
|
parser = argparse.ArgumentParser()
|
||
|
parser.add_argument("src", type=str)
|
||
|
parser.add_argument("dst", type=str)
|
||
|
args = parser.parse_args()
|
||
|
return Replacer(args.src, args.dst)
|