Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
### Fixed
- [#3916](https://github.com/plotly/dash/pull/3916) Fixed a regression where dragging multiple files into `dcc.Upload` would upload only the first file when `multiple=True`
- [#3922](https://github.com/plotly/dash/pull/3922) Fix `dcc.Input(type="number")` stepper behavior when only `min` is set.
- [#3925](https://github.com/plotly/dash/pull/3925) Use the proxied url as the Jupyter server url so `DASH_PROXY` is honored by the external url and inline iframe in notebooks.

## [4.4.1] - 2026-07-21

Expand Down
8 changes: 8 additions & 0 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2605,6 +2605,14 @@ def verify_url_part(served_part, url_part, part_name):
extra_files.append(path)

if jupyter_dash.active:
if jupyter_server_url is None and proxy:
# The app is served on host:port but reached through the proxy,
# so the notebook must display the proxied url.
proxied_url = urlparse(proxy.split("::")[1])
jupyter_server_url = (
f"{proxied_url.scheme}://{proxied_url.hostname}"
+ (f":{proxied_url.port}" if proxied_url.port else "")
)
jupyter_dash.run_app(
self,
mode=jupyter_mode,
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from flask import Flask

from dash import Dash, exceptions as _exc
from dash._jupyter import jupyter_dash

# noinspection PyProtectedMember
from dash._configs import (
Expand Down Expand Up @@ -379,6 +380,21 @@ def test_proxy_success(mocker, caplog, empty_environ, proxy, host, port, path):
assert "Dash is running on {}{}\n".format(proxy, path) in caplog.text


def test_proxy_jupyter_server_url(mocker, empty_environ):
# The app is served on host:port but reached through the proxy, so the
# notebook must be given the proxied url.
proxy = "https://daash.plot.ly"
host, port = "127.0.0.1", 8050
app = Dash()
mocker.patch.object(app.server, "run")
mocker.patch.object(type(jupyter_dash), "active", True)
run_app = mocker.patch.object(jupyter_dash, "run_app")

app.run(proxy="http://{}:{}::{}".format(host, port, proxy), host=host, port=port)

assert run_app.call_args.kwargs["server_url"] == proxy


def test_proxy_failure(mocker, empty_environ):
app = Dash()

Expand Down
Loading