Fix#2184, mitmweb -n dispalys incorrect message. (#2187)

* Fixes #2184, python code.

* Fixes #2184, JavaScript code.

* [web] Update Footer.jsx (#2184)
This commit is contained in:
Matthew Shao 2017-03-21 19:26:04 -05:00 committed by Maximilian Hils
parent 00902e6feb
commit ab2fcbef8d
3 changed files with 9 additions and 10 deletions

View File

@ -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):

View File

@ -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),

View File

@ -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 (
<footer>
{mode && mode != "regular" && (
@ -48,9 +48,11 @@ function Footer({ settings }) {
<span className="label label-success">stream: {formatSize(stream_large_bodies)}</span>
)}
<div className="pull-right">
{server && (
<span className="label label-primary" title="HTTP Proxy Server Address">
{listen_host||"*"}:{listen_port}
</span>
)}
<span className="label label-info" title="Mitmproxy Version">
v{version}
</span>