microsoft / microsoft/vscode-containers
Have 'Open in Browser' check sensible defaults before complaining 'No valid ports are available'
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 139
- Forks
- 87
- Avg merge
- 9h 15m
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
Sometimes desiring isolation makes us prefer not mapping ports to the container host.
Currently, when I right-click a container in the VS Code ContainerTools (ms-azuretools.vscode-containers ver 2.1.0) and select "Open in Browser", a notification appears saying ''No valid ports are available'. The container runs a website without any port mappings.
Describe the solution you'd like
I'd like the extension to check sensible defaults before complaining that no valid ports are available. Specifically:
Is the container listening on port 443?
Yes = point the browser to HTTPS://<container's IP>
No =
Is the container listening on port 80?
Yes = point the browser to HTTP://<container's IP>
No = Now you can complain 'No valid ports are available'.
Describe alternatives you've considered
This is what I do now: bookmark the site in my browser so I can manually launch my browser and manually select the bookmark.
Alternatively, Feature #148, prompting for a port and remembering it for that container would also suffice nicely.
Thank you for considering this feature request!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TypeScript implementation of the "Open in Browser" command and inspect how it discovers container ports and addresses. Done means containers without mapped ports open over HTTPS on port 443 or HTTP on port 80 when available, while other containers still show "No valid ports are available".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, typescript, vscode
- Domain
- desktop, devtools
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100