diff --git a/mitmproxy/tools/web/app.py b/mitmproxy/tools/web/app.py index b7cf2c9db..f873b3515 100644 --- a/mitmproxy/tools/web/app.py +++ b/mitmproxy/tools/web/app.py @@ -194,7 +194,7 @@ class WebSocketEventBroadcaster(tornado.websocket.WebSocketHandler): @classmethod def broadcast(cls, **kwargs): - message = json.dumps(kwargs, ensure_ascii=False) + message = json.dumps(kwargs, ensure_ascii=False).encode("utf8", "surrogateescape") for conn in cls.connections: try: