mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
add metadata info to flow detail view
This commit is contained in:
parent
ea97f62975
commit
4b04566a34
@ -76,7 +76,6 @@ class WebSocketLayer(base.Layer):
|
|||||||
|
|
||||||
websocket_message = t(self.flow, not is_server, payload)
|
websocket_message = t(self.flow, not is_server, payload)
|
||||||
self.flow.messages.append(websocket_message)
|
self.flow.messages.append(websocket_message)
|
||||||
self.log("WebSocket message: {}".format(websocket_message.info), "info")
|
|
||||||
self.channel.ask("websocket_message", self.flow)
|
self.channel.ask("websocket_message", self.flow)
|
||||||
|
|
||||||
# chunk payload into multiple 10kB frames, and send them
|
# chunk payload into multiple 10kB frames, and send them
|
||||||
|
@ -14,10 +14,16 @@ def maybe_timestamp(base, attr):
|
|||||||
def flowdetails(state, flow):
|
def flowdetails(state, flow):
|
||||||
text = []
|
text = []
|
||||||
|
|
||||||
cc = flow.client_conn
|
|
||||||
sc = flow.server_conn
|
sc = flow.server_conn
|
||||||
|
cc = flow.client_conn
|
||||||
req = flow.request
|
req = flow.request
|
||||||
resp = flow.response
|
resp = flow.response
|
||||||
|
metadata = flow.metadata
|
||||||
|
|
||||||
|
if metadata is not None and len(metadata.items()) > 0:
|
||||||
|
parts = [[str(k), repr(v)] for k, v in metadata.items()]
|
||||||
|
text.append(urwid.Text([("head", "Metadata:")]))
|
||||||
|
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
||||||
|
|
||||||
if sc is not None:
|
if sc is not None:
|
||||||
text.append(urwid.Text([("head", "Server Connection:")]))
|
text.append(urwid.Text([("head", "Server Connection:")]))
|
||||||
@ -109,6 +115,7 @@ def flowdetails(state, flow):
|
|||||||
maybe_timestamp(cc, "timestamp_ssl_setup")
|
maybe_timestamp(cc, "timestamp_ssl_setup")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if sc is not None and sc.timestamp_start:
|
if sc is not None and sc.timestamp_start:
|
||||||
parts.append(
|
parts.append(
|
||||||
[
|
[
|
||||||
@ -129,6 +136,7 @@ def flowdetails(state, flow):
|
|||||||
maybe_timestamp(sc, "timestamp_ssl_setup")
|
maybe_timestamp(sc, "timestamp_ssl_setup")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if req is not None and req.timestamp_start:
|
if req is not None and req.timestamp_start:
|
||||||
parts.append(
|
parts.append(
|
||||||
[
|
[
|
||||||
@ -142,6 +150,7 @@ def flowdetails(state, flow):
|
|||||||
maybe_timestamp(req, "timestamp_end")
|
maybe_timestamp(req, "timestamp_end")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if resp is not None and resp.timestamp_start:
|
if resp is not None and resp.timestamp_start:
|
||||||
parts.append(
|
parts.append(
|
||||||
[
|
[
|
||||||
@ -162,4 +171,5 @@ def flowdetails(state, flow):
|
|||||||
|
|
||||||
text.append(urwid.Text([("head", "Timing:")]))
|
text.append(urwid.Text([("head", "Timing:")]))
|
||||||
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
||||||
|
|
||||||
return searchable.Searchable(state, text)
|
return searchable.Searchable(state, text)
|
||||||
|
Loading…
Reference in New Issue
Block a user