Skip to content

Commit 3dea5cb

Browse files
committed
Perform URL proxying, if necessary (RSW)
1 parent 98167c0 commit 3dea5cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shiny/_launchbrowser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import os
33
import webbrowser
44

5+
from ._hostenv import get_proxy_url
6+
57

68
class LaunchBrowserHandler(logging.Handler):
79
"""Uvicorn log reader, detects successful app startup so we can launch a browser.
@@ -34,4 +36,5 @@ def emit(self, record: logging.LogRecord) -> None:
3436
# For some reason the shiny port isn't set correctly!?
3537
return
3638
host = os.environ["SHINY_HOST"]
37-
webbrowser.open(f"http://{host}:{port}/", 1)
39+
url = get_proxy_url(f"http://{host}:{port}/")
40+
webbrowser.open(url, 1)

0 commit comments

Comments
 (0)