dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Dashboard not accessible on 'localhost' in devcontainer (127.0.0.1 ok)

Open paulyuk opened this issue 3 years ago • 1 comments

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:

paulyuk avatar Sep 18 '21 22:09 paulyuk

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 to 127.0.0.1.
  • Dashboard's webserver.go uses http.Server to listen on 0.0.0.0, so it should accept all interfaces, not just localhost. However, changing it to use 127.0.0.1 explicitly makes it work in a devcontainer.

CodeMonkeyLeet avatar Sep 23 '21 17:09 CodeMonkeyLeet