From ab2fcbef8dceb5abc97f7e73638629ded606daa6 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Tue, 21 Mar 2017 19:26:04 -0500 Subject: [PATCH] Fix#2184, mitmweb -n dispalys incorrect message. (#2187) * Fixes #2184, python code. * Fixes #2184, JavaScript code. * [web] Update Footer.jsx (#2184) --- mitmproxy/tools/web/app.py | 1 + mitmproxy/tools/web/master.py | 8 ++------ web/src/js/components/Footer.jsx | 10 ++++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/mitmproxy/tools/web/app.py b/mitmproxy/tools/web/app.py index 23d620e0b..13c7f1e2c 100644 --- a/mitmproxy/tools/web/app.py +++ b/mitmproxy/tools/web/app.py @@ -422,6 +422,7 @@ class Settings(RequestHandler): contentViews=[v.name.replace(' ', '_') for v in contentviews.views], listen_host=self.master.options.listen_host, listen_port=self.master.options.listen_port, + server=self.master.options.server, )) def put(self): diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py index e28bd0025..0db5a09f2 100644 --- a/mitmproxy/tools/web/master.py +++ b/mitmproxy/tools/web/master.py @@ -9,6 +9,7 @@ from mitmproxy.addons import eventstore from mitmproxy.addons import intercept 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 @@ -35,7 +36,7 @@ class WebMaster(master.Master): self.events, ) if with_termlog: - self.addons.add(termlog.TermLog()) + self.addons.add(termlog.TermLog(), termstatus.TermStatus()) self.app = app.Application( self, self.options.web_debug ) @@ -99,11 +100,6 @@ class WebMaster(master.Master): iol.add_callback(self.start) tornado.ioloop.PeriodicCallback(lambda: self.tick(timeout=0), 5).start() - self.add_log( - "Proxy server listening at http://{}:{}/".format(self.server.address[0], self.server.address[1]), - "info" - ) - web_url = "http://{}:{}/".format(self.options.web_iface, self.options.web_port) self.add_log( "Web server listening at {}".format(web_url), diff --git a/web/src/js/components/Footer.jsx b/web/src/js/components/Footer.jsx index 58dd0dcb5..c06438e98 100644 --- a/web/src/js/components/Footer.jsx +++ b/web/src/js/components/Footer.jsx @@ -8,7 +8,7 @@ Footer.propTypes = { function Footer({ settings }) { let {mode, intercept, showhost, no_upstream_cert, rawtcp, http2, websocket, anticache, anticomp, - stickyauth, stickycookie, stream_large_bodies, listen_host, listen_port, version} = settings; + stickyauth, stickycookie, stream_large_bodies, listen_host, listen_port, version, server} = settings; return (