diff options
-rw-r--r-- | mitmproxy/options.py | 18 | ||||
-rw-r--r-- | mitmproxy/tools/web/master.py | 3 | ||||
-rw-r--r-- | mitmproxy/tools/web/webaddons.py | 18 |
3 files changed, 20 insertions, 19 deletions
diff --git a/mitmproxy/options.py b/mitmproxy/options.py index 8a01cf40..7df7736d 100644 --- a/mitmproxy/options.py +++ b/mitmproxy/options.py @@ -437,24 +437,6 @@ class Options(optmanager.OptManager): "Limit which flows are displayed." ) - # Web options - self.add_option( - "web_open_browser", bool, True, - "Start a browser." - ) - self.add_option( - "web_debug", bool, False, - "Mitmweb debugging." - ) - self.add_option( - "web_port", int, 8081, - "Mitmweb port." - ) - self.add_option( - "web_iface", str, "127.0.0.1", - "Mitmweb interface." - ) - # Dump options self.add_option( "flow_detail", int, 1, diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py index dc5b2627..a36d3a87 100644 --- a/mitmproxy/tools/web/master.py +++ b/mitmproxy/tools/web/master.py @@ -13,7 +13,7 @@ from mitmproxy.addons import termlog from mitmproxy.addons import view from mitmproxy.addons import termstatus from mitmproxy.options import Options # noqa -from mitmproxy.tools.web import app +from mitmproxy.tools.web import app, webaddons class WebMaster(master.Master): @@ -34,6 +34,7 @@ class WebMaster(master.Master): self.addons.add(*addons.default_addons()) self.addons.add( + webaddons.WebOptions(), intercept.Intercept(), readfile.ReadFile(), self.view, diff --git a/mitmproxy/tools/web/webaddons.py b/mitmproxy/tools/web/webaddons.py new file mode 100644 index 00000000..f3b745bc --- /dev/null +++ b/mitmproxy/tools/web/webaddons.py @@ -0,0 +1,18 @@ +class WebOptions: + def load(self, loader): + loader.add_option( + "web_open_browser", bool, True, + "Start a browser." + ) + loader.add_option( + "web_debug", bool, False, + "Mitmweb debugging." + ) + loader.add_option( + "web_port", int, 8081, + "Mitmweb port." + ) + loader.add_option( + "web_iface", str, "127.0.0.1", + "Mitmweb interface." + ) |