File: arguments.py

package info (click to toggle)
mitmproxy 0.18.2-6%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 37,444 kB
  • sloc: python: 33,213; makefile: 167; ansic: 68; sh: 48
file content (17 lines) | stat: -rw-r--r-- 394 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)