diff options
author | 依云 <lilydjwg@gmail.com> | 2016-03-10 15:08:34 +0800 |
---|---|---|
committer | lilydjwg <lilydjwg@gmail.com> | 2016-03-10 21:23:31 +0800 |
commit | e9bff5ac565f4d8e9e9db224ee5f95684dd4c049 (patch) | |
tree | 0216f31effdabe1e6e004931a05952284b84cabd | |
parent | b413a052f96896d387f58e903203cf2e29c6f1f6 (diff) | |
download | mitmproxy-e9bff5ac565f4d8e9e9db224ee5f95684dd4c049.tar.gz mitmproxy-e9bff5ac565f4d8e9e9db224ee5f95684dd4c049.tar.bz2 mitmproxy-e9bff5ac565f4d8e9e9db224ee5f95684dd4c049.zip |
add resolved IP address in "Details" tab
-rw-r--r-- | mitmproxy/console/flowdetailview.py | 1 | ||||
-rw-r--r-- | mitmproxy/flow_format_compat.py | 1 | ||||
-rw-r--r-- | mitmproxy/models/connections.py | 1 | ||||
-rw-r--r-- | netlib/tcp.py | 3 |
4 files changed, 6 insertions, 0 deletions
diff --git a/mitmproxy/console/flowdetailview.py b/mitmproxy/console/flowdetailview.py index 757c76fd..add2ebd0 100644 --- a/mitmproxy/console/flowdetailview.py +++ b/mitmproxy/console/flowdetailview.py @@ -23,6 +23,7 @@ def flowdetails(state, flow): text.append(urwid.Text([("head", "Server Connection:")])) parts = [ ["Address", repr(sc.address)], + ["Resolved", repr(sc.sock_address)], ] text.extend( diff --git a/mitmproxy/flow_format_compat.py b/mitmproxy/flow_format_compat.py index a7a95af3..b96c6bcb 100644 --- a/mitmproxy/flow_format_compat.py +++ b/mitmproxy/flow_format_compat.py @@ -35,6 +35,7 @@ def convert_015_016(data): def convert_016_017(data): + data["server_conn"]["sock_address"] = None data["version"] = (0, 17) return data diff --git a/mitmproxy/models/connections.py b/mitmproxy/models/connections.py index 857580b8..6df67150 100644 --- a/mitmproxy/models/connections.py +++ b/mitmproxy/models/connections.py @@ -120,6 +120,7 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject): timestamp_tcp_setup=float, timestamp_ssl_setup=float, address=tcp.Address, + sock_address=tcp.Address, source_address=tcp.Address, cert=certutils.SSLCert, ssl_established=bool, diff --git a/netlib/tcp.py b/netlib/tcp.py index 6423888a..4d01a03b 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -458,9 +458,11 @@ class _Connection(object): def __init__(self, connection): if connection: self.connection = connection + self.sock_address = Address(connection.getpeername()) self._makefile() else: self.connection = None + self.sock_address = None self.rfile = None self.wfile = None @@ -701,6 +703,7 @@ class TCPClient(_Connection): 'Error connecting to "%s": %s' % (self.address.host, err)) self.connection = connection + self.sock_address = Address(connection.getpeername()) self._makefile() def settimeout(self, n): |