add metadata info to flow detail view

This commit is contained in:
Thomas Kriechbaumer 2016-11-22 22:22:56 +01:00
parent ea97f62975
commit 4b04566a34
2 changed files with 11 additions and 2 deletions

View File

@ -76,7 +76,6 @@ class WebSocketLayer(base.Layer):
websocket_message = t(self.flow, not is_server, payload)
self.flow.messages.append(websocket_message)
self.log("WebSocket message: {}".format(websocket_message.info), "info")
self.channel.ask("websocket_message", self.flow)
# chunk payload into multiple 10kB frames, and send them

View File

@ -14,10 +14,16 @@ def maybe_timestamp(base, attr):
def flowdetails(state, flow):
text = []
cc = flow.client_conn
sc = flow.server_conn
cc = flow.client_conn
req = flow.request
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:
text.append(urwid.Text([("head", "Server Connection:")]))
@ -109,6 +115,7 @@ def flowdetails(state, flow):
maybe_timestamp(cc, "timestamp_ssl_setup")
]
)
if sc is not None and sc.timestamp_start:
parts.append(
[
@ -129,6 +136,7 @@ def flowdetails(state, flow):
maybe_timestamp(sc, "timestamp_ssl_setup")
]
)
if req is not None and req.timestamp_start:
parts.append(
[
@ -142,6 +150,7 @@ def flowdetails(state, flow):
maybe_timestamp(req, "timestamp_end")
]
)
if resp is not None and resp.timestamp_start:
parts.append(
[
@ -162,4 +171,5 @@ def flowdetails(state, flow):
text.append(urwid.Text([("head", "Timing:")]))
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
return searchable.Searchable(state, text)