diff options
Diffstat (limited to 'mitmproxy/tools')
| -rw-r--r-- | mitmproxy/tools/cmdline.py | 1 | ||||
| -rw-r--r-- | mitmproxy/tools/console/consoleaddons.py | 6 | ||||
| -rw-r--r-- | mitmproxy/tools/console/defaultkeys.py | 2 | ||||
| -rw-r--r-- | mitmproxy/tools/console/master.py | 2 | ||||
| -rw-r--r-- | mitmproxy/tools/main.py | 14 | ||||
| -rw-r--r-- | mitmproxy/tools/web/static/static.js | 1 |
6 files changed, 20 insertions, 6 deletions
diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py index f919486b..d611a8d2 100644 --- a/mitmproxy/tools/cmdline.py +++ b/mitmproxy/tools/cmdline.py @@ -73,6 +73,7 @@ def common_options(parser, opts): opts.make_parser(group, "upstream_auth", metavar="USER:PASS") opts.make_parser(group, "proxyauth", metavar="SPEC") opts.make_parser(group, "rawtcp") + opts.make_parser(group, "http2") # Proxy SSL options group = parser.add_argument_group("SSL") diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py index 87542fd4..49934e4d 100644 --- a/mitmproxy/tools/console/consoleaddons.py +++ b/mitmproxy/tools/console/consoleaddons.py @@ -116,12 +116,14 @@ class ConsoleAddon: """ return ["single", "vertical", "horizontal"] - @command.command("intercept_toggle") + @command.command("console.intercept.toggle") def intercept_toggle(self) -> None: """ Toggles interception on/off leaving intercept filters intact. """ - ctx.options.intercept_active = not ctx.options.intercept_active + ctx.options.update( + intercept_active = not ctx.options.intercept_active + ) @command.command("console.layout.cycle") def layout_cycle(self) -> None: diff --git a/mitmproxy/tools/console/defaultkeys.py b/mitmproxy/tools/console/defaultkeys.py index 4634b1e2..8139569e 100644 --- a/mitmproxy/tools/console/defaultkeys.py +++ b/mitmproxy/tools/console/defaultkeys.py @@ -24,7 +24,7 @@ def map(km): km.add("ctrl f", "console.nav.pagedown", ["global"], "Page down") km.add("ctrl b", "console.nav.pageup", ["global"], "Page up") - km.add("I", "console.command intercept_toggle", ["global"], "Toggle intercept") + km.add("I", "console.intercept.toggle", ["global"], "Toggle intercept") km.add("i", "console.command set intercept=", ["global"], "Set intercept") km.add("W", "console.command set save_stream_file=", ["global"], "Stream to file") km.add("A", "flow.resume @all", ["flowlist", "flowview"], "Resume all intercepted flows") diff --git a/mitmproxy/tools/console/master.py b/mitmproxy/tools/console/master.py index ef3ab0b3..0d9dee9b 100644 --- a/mitmproxy/tools/console/master.py +++ b/mitmproxy/tools/console/master.py @@ -59,7 +59,7 @@ class ConsoleMaster(master.Master): self.window = None def __setattr__(self, name, value): - self.__dict__[name] = value + super().__setattr__(name, value) signals.update_settings.send(self) def options_error(self, opts, exc): diff --git a/mitmproxy/tools/main.py b/mitmproxy/tools/main.py index d8d16ea4..3735cbf4 100644 --- a/mitmproxy/tools/main.py +++ b/mitmproxy/tools/main.py @@ -20,7 +20,7 @@ from mitmproxy import options # noqa from mitmproxy import optmanager # noqa from mitmproxy import proxy # noqa from mitmproxy import log # noqa -from mitmproxy.utils import debug # noqa +from mitmproxy.utils import debug, arg_check # noqa def assert_utf8_env(): @@ -72,7 +72,17 @@ def run( master = master_cls(opts) parser = make_parser(opts) - args = parser.parse_args(arguments) + + # To make migration from 2.x to 3.0 bearable. + if "-R" in sys.argv and sys.argv[sys.argv.index("-R") + 1].startswith("http"): + print("-R is used for specifying replacements.\n" + "To use mitmproxy in reverse mode please use --mode reverse:SPEC instead") + + try: + args = parser.parse_args(arguments) + except SystemExit: + arg_check.check() + sys.exit(1) try: unknown = optmanager.load_paths(opts, args.conf) pconf = process_options(parser, opts, args) diff --git a/mitmproxy/tools/web/static/static.js b/mitmproxy/tools/web/static/static.js new file mode 100644 index 00000000..4ffedbcf --- /dev/null +++ b/mitmproxy/tools/web/static/static.js @@ -0,0 +1 @@ +MITMWEB_STATIC = false;
\ No newline at end of file |
