dashboard
dashboard copied to clipboard
Dashboard not accessible on 'localhost' in devcontainer (127.0.0.1 ok)
Expected Behavior
Dashboard loads in browser on host machine, thanks to port forward from VS Code into the container.
Actual Behavior
Browser spins indefinitely trying to reach address.
Steps to Reproduce the Problem
Load the official dapr/quickstart repo (now based on Dapr 1.4) in a DevContainer: using VS Code + Remote Container extension, and open dev container when prompted.
Start the dashboard. View in browser, e.g. http://localhost:8080.
codespace$ dapr dashboard
http://localhost:8080/ <-- fails, spins
http://127.0.0.1:8080/ <- works
codespace$ dapr dashboard -p 9999
http://localhost:9999/ <-- fails, spins
http://127.0.0.1:9999/ <- works
It repros on PC and macOS. sometimes i take an additional step in vscode to add a user defined port forward, after removing the auto.
Release Note
RELEASE NOTE:
Additional observations:
- Other webhosts work in the devcontainer to the same ports (e.g.
ng serve
to 8080) - Running
dapr dashboard -k
works, vscode opens a port to127.0.0.1
. - Dashboard's webserver.go uses
http.Server
to listen on0.0.0.0
, so it should accept all interfaces, not just localhost. However, changing it to use127.0.0.1
explicitly makes it work in a devcontainer.