diff --git a/mitmproxy/addons/dumper.py b/mitmproxy/addons/dumper.py index c2930c5ad..28a538de5 100644 --- a/mitmproxy/addons/dumper.py +++ b/mitmproxy/addons/dumper.py @@ -345,15 +345,24 @@ class Dumper: message = f.messages[-1] direction = "->" if message.from_client else "<-" if f.client_conn.tls_version == "QUIC": - type_ = f"quic/{f.type}" + if f.type == "tcp": + quic_type = "stream" + else: + quic_type = "dgrams" + # TODO: This should not be metadata, this should be typed attributes. + flow_type = ( + f"quic {quic_type} {f.metadata.get('quic_stream_id_client','')} " + f"{direction} mitmproxy {direction} " + f"quic {quic_type} {f.metadata.get('quic_stream_id_server','')}" + ) else: - type_ = f.type + flow_type = f.type self.echo( "{client} {direction} {type} {direction} {server}".format( client=human.format_address(f.client_conn.peername), server=human.format_address(f.server_conn.address), direction=direction, - type=type_, + type=flow_type, ) ) if ctx.options.flow_detail >= 3: diff --git a/test/mitmproxy/addons/test_dumper.py b/test/mitmproxy/addons/test_dumper.py index cf254b811..c7f2e85d4 100644 --- a/test/mitmproxy/addons/test_dumper.py +++ b/test/mitmproxy/addons/test_dumper.py @@ -292,8 +292,19 @@ def test_quic(): with taddons.context(d): f = tflow.ttcpflow() f.client_conn.tls_version = "QUIC" + # TODO: This should not be metadata, this should be typed attributes. + f.metadata["quic_stream_id_client"] = 1 + f.metadata["quic_stream_id_server"] = 1 d.tcp_message(f) - assert "quic/tcp" in sio.getvalue() + assert "quic stream 1" in sio.getvalue() + + f2 = tflow.tudpflow() + f2.client_conn.tls_version = "QUIC" + # TODO: This should not be metadata, this should be typed attributes. + f2.metadata["quic_stream_id_client"] = 1 + f2.metadata["quic_stream_id_server"] = 1 + d.udp_message(f2) + assert "quic stream 1" in sio.getvalue() def test_styling(): diff --git a/web/src/js/ducks/_options_gen.ts b/web/src/js/ducks/_options_gen.ts index 2f6c08a38..9bd8a8333 100644 --- a/web/src/js/ducks/_options_gen.ts +++ b/web/src/js/ducks/_options_gen.ts @@ -58,6 +58,7 @@ export interface OptionsState { server_replay_kill_extra: boolean; server_replay_nopop: boolean; server_replay_refresh: boolean; + server_replay_reuse: boolean; server_replay_use_headers: string[]; showhost: boolean; ssl_insecure: boolean; @@ -151,6 +152,7 @@ export const defaultState: OptionsState = { server_replay_kill_extra: false, server_replay_nopop: false, server_replay_refresh: true, + server_replay_reuse: false, server_replay_use_headers: [], showhost: false, ssl_insecure: false,