aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/tools')
-rw-r--r--mitmproxy/tools/main.py2
-rw-r--r--mitmproxy/tools/web/app.py12
-rw-r--r--mitmproxy/tools/web/master.py1
3 files changed, 11 insertions, 4 deletions
diff --git a/mitmproxy/tools/main.py b/mitmproxy/tools/main.py
index 7debb3e0..58900d29 100644
--- a/mitmproxy/tools/main.py
+++ b/mitmproxy/tools/main.py
@@ -16,7 +16,6 @@ from mitmproxy import exceptions # noqa
from mitmproxy import options # noqa
from mitmproxy import optmanager # noqa
from mitmproxy import proxy # noqa
-from mitmproxy.utils import version_check # noqa
from mitmproxy.utils import debug # noqa
@@ -58,7 +57,6 @@ def run(MasterKlass, args, extra=None): # pragma: no cover
extra: Extra argument processing callable which returns a dict of
options.
"""
- version_check.check_pyopenssl_version()
debug.register_info_dumpers()
opts = options.Options()
diff --git a/mitmproxy/tools/web/app.py b/mitmproxy/tools/web/app.py
index c6fb2ef6..9a447fe7 100644
--- a/mitmproxy/tools/web/app.py
+++ b/mitmproxy/tools/web/app.py
@@ -18,6 +18,7 @@ from mitmproxy import io
from mitmproxy import log
from mitmproxy import version
from mitmproxy import optmanager
+from mitmproxy.tools.cmdline import CONFIG_PATH
import mitmproxy.tools.web.master # noqa
@@ -451,6 +452,14 @@ class Options(RequestHandler):
raise APIError(400, "{}".format(err))
+class SaveOptions(RequestHandler):
+ def post(self):
+ try:
+ optmanager.save(self.master.options, CONFIG_PATH, True)
+ except Exception as err:
+ raise APIError(400, "{}".format(err))
+
+
class Application(tornado.web.Application):
def __init__(self, master, debug):
self.master = master
@@ -475,7 +484,8 @@ class Application(tornado.web.Application):
FlowContentView),
(r"/settings", Settings),
(r"/clear", ClearAll),
- (r"/options", Options)
+ (r"/options", Options),
+ (r"/options/save", SaveOptions)
]
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "templates"),
diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py
index 8c2433ec..dc5b2627 100644
--- a/mitmproxy/tools/web/master.py
+++ b/mitmproxy/tools/web/master.py
@@ -125,7 +125,6 @@ class WebMaster(master.Master):
"No web browser found. Please open a browser and point it to {}".format(web_url),
"info"
)
-
try:
iol.start()
except KeyboardInterrupt: