You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support forwarding to other hosts only reachable from remote in remote.SSH.defaultForwardedPorts (like the Ports tab) #11929
In the Ports tab, I can forward a port on a host that is reachable from the SSH remote (not the remote itself) by entering hostname:port. This works perfectly:
Port
Forwarded Address
Origin
hostname:8080
localhost:8080
User Forwarded
hostname:2705
localhost:2705
User Forwarded
However, there is no way to configure the same forwards in settings.json via remote.SSH.defaultForwardedPorts:
"remote.SSH.defaultForwardedPorts": [
{
"name": "Service on other host",
"localPort": 8080,
"remotePort": 8080,
"host": "hostname"// ignored: forwarding remote localhost
},
{
"name": "Service on other host",
"localPort": 2705,
"remotePort": "hostname:2705"// Incorrect type. Expected number
}
]
A host property is not part of the schema and is ignored.
the forward always targets localhost:<remotePort> on the SSH remote.
remote.SSH.defaultForwardedPorts should support the same targets as the Ports view, either via:
a new optional host property (default: localhost), or
accepting "hostname:port" as remotePort like in the ports tab.
Use case
Services in an internal network are only reachable through the SSH remote (jump host).
Currently I can configure this with LocalForward in ~/.ssh/config or forward ports manually in the Ports view, but I would like to define these forwards in settings.json, together with my other port forwards, without depending on the SSH config which makes setting dynamic ports via attributes easier.
Screenshot eith the wanted behavior from the ports tab
Activity