mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 14:58:38 +00:00
Merge pull request #2401 from ujjwal96/ip-formatting
Fix ip formatting in websocket messages
This commit is contained in:
commit
6d284f5a2e
@ -4,7 +4,7 @@ from typing import List, Optional
|
||||
from mitmproxy import flow
|
||||
from mitmproxy.net import websockets
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.utils import strutils
|
||||
from mitmproxy.utils import strutils, human
|
||||
|
||||
|
||||
class WebSocketMessage(serializable.Serializable):
|
||||
@ -94,8 +94,8 @@ class WebSocketFlow(flow.Flow):
|
||||
def message_info(self, message: WebSocketMessage) -> str:
|
||||
return "{client} {direction} WebSocket {type} message {direction} {server}{endpoint}".format(
|
||||
type=message.type,
|
||||
client=repr(self.client_conn.address),
|
||||
server=repr(self.server_conn.address),
|
||||
client=human.format_address(self.client_conn.address),
|
||||
server=human.format_address(self.server_conn.address),
|
||||
direction="->" if message.from_client else "<-",
|
||||
endpoint=self.handshake_flow.request.path,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user