MCPcopy
hub / github.com/mitmproxy/mitmproxy / websocket_message

Method websocket_message

mitmproxy/addons/dumper.py:301–313  ·  view source on GitHub ↗
(self, f: http.HTTPFlow)

Source from the content-addressed store, hash-verified

299 self.echo_flow(f)
300
301 def websocket_message(self, f: http.HTTPFlow):
302 assert f.websocket is not None # satisfy type checker
303 if self.match(f):
304 message = f.websocket.messages[-1]
305
306 direction = "->" if message.from_client else "<-"
307 self.echo(
308 f"{human.format_address(f.client_conn.peername)} "
309 f"{direction} WebSocket {message.type.name.lower()} message "
310 f"{direction} {human.format_address(f.server_conn.address)}{f.request.path}"
311 )
312 if ctx.options.flow_detail >= 3:
313 self._echo_message(message, f)
314
315 def websocket_end(self, f: http.HTTPFlow):
316 assert f.websocket is not None # satisfy type checker

Callers 1

test_websocketFunction · 0.95

Calls 3

matchMethod · 0.95
echoMethod · 0.95
_echo_messageMethod · 0.95

Tested by 1

test_websocketFunction · 0.76