Repository navigation
Description
Problem
Remote extensions current each implement their own version of port forwarding, including their own configuration and UI related to port forwarding (see the ssh and containers extensions for example). Even with just two extensions supporting port forwarding, the UX around port forwarding is not consistent and we have duplicated development effort. This problem will become worse as more extensions / scenarios add support for port forwarding
Additionally, VS Code has a built-in tunneling mechanism that can be used to implement a limited version of port forwarding even if the remote extension doesn't directly support it. There is currently no UI for managing these tunnels. Managing these will become important if we allow extensions to open new tunnels, as #81131 proposes
Proposal
Build a unified port forwarding user experience that the remote extensions can contribute to. This would act somewhat like the existing Remote Explorer contribution
High level UX Needs
- List ports currently being forwarded
- Include human readable names
- Maybe include type (through VS Code's built-in tunnel service, through remote, external, ...)
- Let user close one of these ports
- Let user open a new port forwarding
High level extension API needs
- A way for VS Code to call out to the remote extension to create a new port forwarding. We also need to be able to tear down this connection (probably just make the result of the api call disposable)
- A way for a remote extension to tell us about port forwardings managed outside of VS Code (see ssh's
LocalFowardsupport for an example of this)- We likely also need a way so that the extension can signal that its external port forwardings have changed
- Possible: provide a list of candidate ports for forwarding but that require user action to establish? (see the containers port forwarding ux for an example of this)
/cc Chuck Lantz (@Chuxel) for general feedback, roblourens and Kai Maetzel (@kieferrm) for ssh, and Christof Marti (@chrmarti) for containers
Activity
chrmarti commentedon Sep 25, 2019
Sounds good! For containers it would make sense to also have the following:
Candidate ports would be good to have, so we can carry that feature forward. (We discover ports being listened on and also read a list of candidate ports from the container.)
chrmarti commentedon Sep 25, 2019
/cc Alex Ross (@alexr00)
Chuxel commentedon Sep 25, 2019
Sorry on the delayed response - been a crazy few days.
Yeah I think being able to establish a difference between static publishing/forwarding and the dynamic variation is important for two reasons:
In the explorer, we may need to use slightly different UX to represent them as well given some of the confusion we've seen for containers.
I also agree on candidate ports, but we should also allow someone to just key in a port so they can do the forwarding before the server in question has been started. (I assume this is implied, but figured it would be good to call out.)
chrmarti commentedon Nov 11, 2019
Similar to the UX requirements the API requirements for Remote-Containers are:
It would make sense to include a hostname/ip when specifying a target port. The same port number on different hostnames/ips can be listened on by different processes.
chrmarti commentedon Nov 11, 2019
If that becomes too fine-grained for an API, we could also consider doing a smaller API that allows each extension to contribute a port-forwarding view, similar to the targets and details views.
First pass at port API needed for port UI
5 remaining items
First pass at port API needed for port UI
First pass at port API needed for port UI (#85117)
Implement makeTunnel for localhost
Implement tunnelInformation
Add candidate finding to ports view
Allow extensions to provide a port forwarding implementation.
alexr00 commentedon Dec 16, 2019
Enable more than just localhost for port forwarding providers
Setting for restoring forwarded ports
Web API for tunnels
TunnelFactory web api (#88200)