diff options
Diffstat (limited to 'mitmproxy/addons/dumper.py')
-rw-r--r-- | mitmproxy/addons/dumper.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mitmproxy/addons/dumper.py b/mitmproxy/addons/dumper.py index 3c3e1c65..48bc8118 100644 --- a/mitmproxy/addons/dumper.py +++ b/mitmproxy/addons/dumper.py @@ -174,7 +174,7 @@ class Dumper: # This aligns the HTTP response code with the HTTP request method: # 127.0.0.1:59519: GET http://example.com/ # << 304 Not Modified 0b - arrows = " " * (len(repr(flow.client_conn.address)) - 2) + arrows + arrows = " " * (len(human.format_address(flow.client_conn.address)) - 2) + arrows line = "{replay}{arrows} {code} {reason} {size}".format( replay=replay, @@ -224,7 +224,7 @@ class Dumper: def websocket_error(self, f): self.echo( "Error in WebSocket connection to {}: {}".format( - repr(f.server_conn.address), f.error + human.format_address(f.server_conn.address), f.error ), fg="red" ) @@ -234,6 +234,8 @@ class Dumper: message = f.messages[-1] self.echo(f.message_info(message)) if ctx.options.flow_detail >= 3: + message = message.from_state(message.get_state()) + message.content = message.content.encode() if isinstance(message.content, str) else message.content self._echo_message(message) def websocket_end(self, f): @@ -247,7 +249,7 @@ class Dumper: def tcp_error(self, f): self.echo( "Error in TCP connection to {}: {}".format( - repr(f.server_conn.address), f.error + human.format_address(f.server_conn.address), f.error ), fg="red" ) @@ -257,8 +259,8 @@ class Dumper: message = f.messages[-1] direction = "->" if message.from_client else "<-" self.echo("{client} {direction} tcp {direction} {server}".format( - client=repr(f.client_conn.address), - server=repr(f.server_conn.address), + client=human.format_address(f.client_conn.address), + server=human.format_address(f.server_conn.address), direction=direction, )) if ctx.options.flow_detail >= 3: |