vscode-docker icon indicating copy to clipboard operation
vscode-docker copied to clipboard

Container tooltip's port should not hardcode `localhost`

Open KillahB33 opened this issue 2 years ago • 6 comments

Clicking on the docker port should either be the same IP I am connected to, or let me set it in the settings.

KillahB33 avatar Feb 10 '23 17:02 KillahB33

@KillahB33 can you elaborate on where you're seeing the port and clicking on it?

bwateratmsft avatar Feb 10 '23 18:02 bwateratmsft

Yes, when I hover over the container in the dropdown menu it shows the image, ports, volumes and networks. The ports are links but when you click on it, it goes to localhost: I assume because it's not aware I am also using the remote ssh conector. Apologies for the wait, just saw the email this morning for your response.

KillahB33 avatar Feb 15 '23 11:02 KillahB33

Gotcha, that makes sense. Looking at the code it appears we do hardcode localhost. We have some more advanced logic if you right click the container and do "Open in browser", is that working? If so we can probably extend that logic to this place in the tooltip.

bwateratmsft avatar Feb 15 '23 15:02 bwateratmsft

Was not aware that was on option, very cool. Yes it's working, but it appears VSCode is working as some form of reverse proxy, so the address in the bar is still localhost but it's actually rendering the page.

KillahB33 avatar Feb 15 '23 17:02 KillahB33

Hm, I wonder if VSCode is opening the links in a different manner? I've always been impressed at how well VSCode handles acting like a reverse proxy in remote scenarios.

bwateratmsft avatar Feb 15 '23 17:02 bwateratmsft

Yeah it's pretty neat. I just recently moved to use VSCode more for my remote stuff and it has been really great

KillahB33 avatar Feb 15 '23 18:02 KillahB33