microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 293 forks source link

Open URL in browser or "Follow link" in terminal for a forwarded localhost link discards URL path #10318

Closed fireattack closed 1 month ago

fireattack commented 1 month ago

STR1:

  1. run:
    python -c "import webbrowser;webbrowser.open('http://localhost:8080/test')"
  2. Make sure port forwarding for 8080 is automatically added and assigned a https://*.asse.devtunnels.ms/ URL.

Expected: VS Code opens https://*.asse.devtunnels.ms/test in my browser Observed: VS Code opens https://*.asse.devtunnels.ms/ in my browser

STR2:

  1. in terminal in VS Code, run echo http://127.0.0.1:8080/mypath/
  2. Make sure port forwarding for 8080 is automatically added and assigned a https://*.asse.devtunnels.ms/ URL.
  3. Ctrl+click the above link from stdout in terminal

Expected: it opens https://*.asse.devtunnels.ms/mypath/ in browser Observed: it opens https://*.asse.devtunnels.ms/ in browser


Above is just a minimal example. A real scenario: I sometimes run

>snakeviz event.prof    
snakeviz web server started on 127.0.0.1:8080; enter Ctrl-C to exit
http://127.0.0.1:8080/snakeviz/D%3A%5Ctemp%5Cvimeo%5Cevent.prof
404 GET / (127.0.0.1) 2.00ms

(404'd because VS Code automatically opens https://*.asse.devtunnels.ms/ instead of https://*.asse.devtunnels.ms//snakeviz/D%3A%5Ctemp%5Cvimeo%5Cevent.prof in my browser; and it's very confusing)

alexr00 commented 1 month ago

@fireattack Are you using the Remote SSH extension to connect to your server?

fireattack commented 1 month ago

No, I use "Remote Tunnels", which is what Windows has.