mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
fix #327
This commit is contained in:
@@ -22,6 +22,13 @@ class ClientConnection(tcp.BaseHandler, stateobject.SimpleStateObject):
|
||||
self.timestamp_end = None
|
||||
self.timestamp_ssl_setup = None
|
||||
|
||||
def __repr__(self):
|
||||
return "<ClientConnection: {ssl}{host}:{port}>".format(
|
||||
ssl="[ssl] " if self.ssl_established else "",
|
||||
host=self.address.host,
|
||||
port=self.address.port
|
||||
)
|
||||
|
||||
_stateobject_attributes = dict(
|
||||
timestamp_start=float,
|
||||
timestamp_end=float,
|
||||
@@ -76,6 +83,19 @@ class ServerConnection(tcp.TCPClient, stateobject.SimpleStateObject):
|
||||
self.timestamp_tcp_setup = None
|
||||
self.timestamp_ssl_setup = None
|
||||
|
||||
def __repr__(self):
|
||||
if self.ssl_established and self.sni:
|
||||
ssl = "[ssl: {0}] ".format(self.sni)
|
||||
elif self.ssl_established:
|
||||
ssl = "[ssl] "
|
||||
else:
|
||||
ssl = ""
|
||||
return "<ServerConnection: {ssl}{host}:{port}>".format(
|
||||
ssl=ssl,
|
||||
host=self.address.host,
|
||||
port=self.address.port
|
||||
)
|
||||
|
||||
_stateobject_attributes = dict(
|
||||
state=list,
|
||||
peername=tuple,
|
||||
|
||||
Reference in New Issue
Block a user