2016-10-15 22:12:58 +00:00
|
|
|
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)
|
|
|
|
|
|
|
|
|
2017-03-09 00:52:58 +00:00
|
|
|
def start(opts):
|
2016-10-15 22:12:58 +00:00
|
|
|
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)
|