diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-07-29 20:39:07 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2017-07-29 21:50:45 +0200 |
commit | b2f7995a038a5eff2e74f8326c0e8fe45155a049 (patch) | |
tree | a4cc2bb8cf1eb561a3a8e74557da78f4ca902f82 /mitmproxy | |
parent | 9ffd42edeacb19c3961840289bb25eaeca5991a5 (diff) | |
download | mitmproxy-b2f7995a038a5eff2e74f8326c0e8fe45155a049.tar.gz mitmproxy-b2f7995a038a5eff2e74f8326c0e8fe45155a049.tar.bz2 mitmproxy-b2f7995a038a5eff2e74f8326c0e8fe45155a049.zip |
move web options into their own addon
Diffstat (limited to 'mitmproxy')
-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." + ) |