From cbeb3520c3f16c3d3999986ea6a27e8cc119db8f Mon Sep 17 00:00:00 2001 From: Thomas Kadauke Date: Mon, 16 Mar 2026 07:46:16 -0400 Subject: [PATCH] fix: remove WebSocket message size limit in ingress proxy (#6604) aiohttp's default max_msg_size of 4MB causes the ingress WebSocket proxy to silently drop connections when an add-on sends messages larger than that limit (e.g. Zigbee2MQTT's bridge/devices payload with many devices). Setting max_msg_size=0 removes the limit on both the server-side WebSocketResponse and the upstream ws_connect, fixing dropped connections for add-ons that produce large WebSocket messages. Co-authored-by: Claude Sonnet 4.6 Co-authored-by: J. Nick Koston --- supervisor/api/ingress.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/supervisor/api/ingress.py b/supervisor/api/ingress.py index 378e74d64..a34503846 100644 --- a/supervisor/api/ingress.py +++ b/supervisor/api/ingress.py @@ -39,6 +39,8 @@ from .utils import api_process, api_validate, require_home_assistant _LOGGER: logging.Logger = logging.getLogger(__name__) +MAX_WEBSOCKET_MESSAGE_SIZE = 16 * 1024 * 1024 # 16 MiB + VALIDATE_SESSION_DATA = vol.Schema({ATTR_SESSION: str}) """Expected optional payload of create session request""" @@ -180,7 +182,10 @@ class APIIngress(CoreSysAttributes): req_protocols = [] ws_server = web.WebSocketResponse( - protocols=req_protocols, autoclose=False, autoping=False + protocols=req_protocols, + autoclose=False, + autoping=False, + max_msg_size=MAX_WEBSOCKET_MESSAGE_SIZE, ) await ws_server.prepare(request) @@ -201,6 +206,7 @@ class APIIngress(CoreSysAttributes): protocols=req_protocols, autoclose=False, autoping=False, + max_msg_size=MAX_WEBSOCKET_MESSAGE_SIZE, ) as ws_client: # Proxy requests await asyncio.wait(