Skip to content

defaultForwardedPorts differs from User forwarded Ports #9715

Open

Description

@ReptoxX
  • VSCode Version: 1.87.2
  • Local OS Version: Mac OS
  • Remote OS Version: Ubuntu 22.04
  • Remote Extension/Connection Type: Containers (on Remote Server)

When using a default forwarded Port, forwards containing a different host don't work.
In my example i got a container inside a docker network next to a minio container and a database container. These are accessible inside my application where i remote into via database:3306 or minio:9000. I now want to automatically forward these ports whenever i connect to the remote container and therefore defined it inside the .vscode/settings.json.

	"remote.SSH.defaultForwardedPorts": [
		{
			"localPort": 3306,
			"name": "Database",
			"remotePort": "database:3306"
		},
		{
			"localPort": 9000,
			"name": "Minio",
			"remotePort": "minio:9000"
		},
		{
			"localPort": 9001,
			"name": "Minio (Web)",
			"remotePort": "minio:9001"
		}
	]

These entries don't work as expected and it fails to connect. However when i now remove the default forwarded ports and manually do the portforwarding through the interface (again using host:port), the services become available and function as it should be.

Steps to Reproduce:

  1. Forward a port using settings.json remote.SSH.defaultForwardedPorts try to connect to container.
  2. Remove said port forwards and do it manually, it works now.

In my opinion, the default ports should work exactly the same as the user forwarded ports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugsshIssue in vscode-remote SSH

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions