def get_parsed_args(args=None):
parser = argparse.ArgumentParser(
usage="""
%(prog)s [options] URL_FILE
Example with cookie injection
-----------------------------
%(prog)s --set-headers ":~q ~d example.com:Cookie:Nomz" \\
--strip-headers ":~d example.com:Cookie" \\
test_urls.txt
Injects the Cookie=Nomz HEADER into all example.com DOMAIN REQUESTS
(note that ~q matches requests that don't have a response yet and ~d matches domain)
Please refer to the mitmproxy docs for filter expressions:
http://docs.mitmproxy.org/en/stable/features/filters.html
Additionally, this example will strip the Cookie header in the saved flows.
""".strip()
)
parser.add_argument(
"test_urls",
metavar="URL_FILE",
type=str,
action=UrlFile,
help="Specify a file that contains URLs separated by newlines"
)
add_selenium_options(parser)
add_proxy_options(parser)
add_state_options(parser)
add_validator_options(parser)
add_storage_options(parser)
try:
return parser.parse_args(args=args)
except argparse.ArgumentError as e:
raise CmdlineError(e)
评论列表
文章目录