From 4028449de051650e69efa7c4daf1c1e8315afb81 Mon Sep 17 00:00:00 2001 From: Adrian Borrmann Date: Thu, 11 Jun 2026 10:47:04 -0600 Subject: [PATCH] Fix incorrect websocket pathname --- CHANGELOG.md | 1 + dash/backends/_fastapi.py | 2 +- dash/backends/_quart.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e0404e123..e18cb41c78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Fixed - [#3805](https://github.com/plotly/dash/pull/3805) Fix FastAPI POST routes deadlock caused by middleware consuming request body. Fixes [#3801](https://github.com/plotly/dash/issues/3801). +- [#3813](https://github.com/plotly/dash/pull/3813) Fix websockets using incorrect path when deployed behind a proxy ## [4.2.0] - 2026-06-01 - *The Freedom Update* diff --git a/dash/backends/_fastapi.py b/dash/backends/_fastapi.py index 0516b5edcb..97dce1379a 100644 --- a/dash/backends/_fastapi.py +++ b/dash/backends/_fastapi.py @@ -682,7 +682,7 @@ def serve_websocket_callback(self, dash_app: "Dash"): dash_app: The Dash application instance """ # pylint: disable=too-many-statements,too-many-locals - ws_path = dash_app.config.requests_pathname_prefix + "_dash-ws-callback" + ws_path = dash_app.config.routes_pathname_prefix + "_dash-ws-callback" # Get allowed origins from dash app config allowed_origins = getattr( diff --git a/dash/backends/_quart.py b/dash/backends/_quart.py index c7634ce93a..a6d09d1e1c 100644 --- a/dash/backends/_quart.py +++ b/dash/backends/_quart.py @@ -516,7 +516,7 @@ def serve_websocket_callback(self, dash_app: "Dash"): dash_app: The Dash application instance """ # pylint: disable=too-many-statements,too-many-locals - ws_path = dash_app.config.requests_pathname_prefix + "_dash-ws-callback" + ws_path = dash_app.config.routes_pathname_prefix + "_dash-ws-callback" # pylint: disable=protected-access allowed_origins = getattr(dash_app, "_websocket_allowed_origins", [])