diff options
Diffstat (limited to 'mitmproxy/tools')
-rw-r--r-- | mitmproxy/tools/console/flowdetailview.py | 6 | ||||
-rw-r--r-- | mitmproxy/tools/console/master.py | 8 | ||||
-rw-r--r-- | mitmproxy/tools/console/statusbar.py | 8 | ||||
-rw-r--r-- | mitmproxy/tools/dump.py | 2 | ||||
-rw-r--r-- | mitmproxy/tools/web/master.py | 2 | ||||
-rw-r--r-- | mitmproxy/tools/web/static/app.js | 6 |
6 files changed, 17 insertions, 15 deletions
diff --git a/mitmproxy/tools/console/flowdetailview.py b/mitmproxy/tools/console/flowdetailview.py index d713787a..691f19a5 100644 --- a/mitmproxy/tools/console/flowdetailview.py +++ b/mitmproxy/tools/console/flowdetailview.py @@ -30,8 +30,8 @@ def flowdetails(state, flow: http.HTTPFlow): if sc is not None: text.append(urwid.Text([("head", "Server Connection:")])) parts = [ - ["Address", repr(sc.address)], - ["Resolved Address", repr(sc.ip_address)], + ["Address", "{}:{}".format(sc.address[0], sc.address[1])], + ["Resolved Address", "{}:{}".format(sc.ip_address[0], sc.ip_address[1])], ] if resp: parts.append(["HTTP Version", resp.http_version]) @@ -92,7 +92,7 @@ def flowdetails(state, flow: http.HTTPFlow): text.append(urwid.Text([("head", "Client Connection:")])) parts = [ - ["Address", repr(cc.address)], + ["Address", "{}:{}".format(cc.address[0], cc.address[1])], ] if req: parts.append(["HTTP Version", req.http_version]) diff --git a/mitmproxy/tools/console/master.py b/mitmproxy/tools/console/master.py index 4ab9e1f4..d68dc93c 100644 --- a/mitmproxy/tools/console/master.py +++ b/mitmproxy/tools/console/master.py @@ -429,9 +429,11 @@ class ConsoleMaster(master.Master): super().tcp_message(f) message = f.messages[-1] direction = "->" if message.from_client else "<-" - signals.add_log("{client} {direction} tcp {direction} {server}".format( - client=repr(f.client_conn.address), - server=repr(f.server_conn.address), + signals.add_log("{client_host}:{client_port} {direction} tcp {direction} {server_host}:{server_port}".format( + client_host=f.client_conn.address[0], + client_port=f.client_conn.address[1], + server_host=f.server_conn.address[0], + server_port=f.server_conn.address[1], direction=direction, ), "info") signals.add_log(strutils.bytes_to_escaped_str(message.content), "debug") diff --git a/mitmproxy/tools/console/statusbar.py b/mitmproxy/tools/console/statusbar.py index 2c7f9efb..d90d932b 100644 --- a/mitmproxy/tools/console/statusbar.py +++ b/mitmproxy/tools/console/statusbar.py @@ -238,8 +238,8 @@ class StatusBar(urwid.WidgetWrap): dst = self.master.server.config.upstream_server r.append("[dest:%s]" % mitmproxy.net.http.url.unparse( dst.scheme, - dst.address.host, - dst.address.port + dst.address[0], + dst.address[1], )) if self.master.options.scripts: r.append("[") @@ -272,10 +272,10 @@ class StatusBar(urwid.WidgetWrap): ] if self.master.server.bound: - host = self.master.server.address.host + host = self.master.server.address[0] if host == "0.0.0.0": host = "*" - boundaddr = "[%s:%s]" % (host, self.master.server.address.port) + boundaddr = "[%s:%s]" % (host, self.master.server.address[1]) else: boundaddr = "" t.extend(self.get_status()) diff --git a/mitmproxy/tools/dump.py b/mitmproxy/tools/dump.py index e1e40fb0..fefbddfb 100644 --- a/mitmproxy/tools/dump.py +++ b/mitmproxy/tools/dump.py @@ -46,7 +46,7 @@ class DumpMaster(master.Master): if not self.options.no_server: self.add_log( - "Proxy server listening at http://{}".format(server.address), + "Proxy server listening at http://{}:{}".format(server.address[0], server.address[1]), "info" ) diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py index 6ebcfe47..8c7f579d 100644 --- a/mitmproxy/tools/web/master.py +++ b/mitmproxy/tools/web/master.py @@ -109,7 +109,7 @@ class WebMaster(master.Master): tornado.ioloop.PeriodicCallback(lambda: self.tick(timeout=0), 5).start() self.add_log( - "Proxy server listening at http://{}/".format(self.server.address), + "Proxy server listening at http://{}:{}/".format(self.server.address[0], self.server.address[1]), "info" ) diff --git a/mitmproxy/tools/web/static/app.js b/mitmproxy/tools/web/static/app.js index 480d9c71..c21a478b 100644 --- a/mitmproxy/tools/web/static/app.js +++ b/mitmproxy/tools/web/static/app.js @@ -2046,7 +2046,7 @@ function ConnectionInfo(_ref2) { _react2.default.createElement( 'td', null, - conn.address.address.join(':') + conn.address.join(':') ) ), conn.sni && _react2.default.createElement( @@ -8449,7 +8449,7 @@ module.exports = function () { function destination(regex) { regex = new RegExp(regex, "i"); function destinationFilter(flow) { - return !!flow.server_conn.address && regex.test(flow.server_conn.address.address[0] + ":" + flow.server_conn.address.address[1]); + return !!flow.server_conn.address && regex.test(flow.server_conn.address[0] + ":" + flow.server_conn.address[1]); } destinationFilter.desc = "destination address matches " + regex; return destinationFilter; @@ -8509,7 +8509,7 @@ module.exports = function () { function source(regex) { regex = new RegExp(regex, "i"); function sourceFilter(flow) { - return !!flow.client_conn.address && regex.test(flow.client_conn.address.address[0] + ":" + flow.client_conn.address.address[1]); + return !!flow.client_conn.address && regex.test(flow.client_conn.address[0] + ":" + flow.client_conn.address[1]); } sourceFilter.desc = "source address matches " + regex; return sourceFilter; |