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

Coder Desktop Integration

Open ThomasK33 opened this issue 9 months ago • 0 comments

Implement an enhancement making this extension aware of Coder Desktop. With Coder Desktop running, there is already an established tunnel to a workspace; thus, the extension does not need to create another tunnel.

The extension should prioritize the existing tunnel rather than creating a new one and should be able to display tunnel statistics related to the VPN within the editor.

Related : coder/jetbrains-coder#543

Once coder/internal#466 is closed, this work can begin.

The extension should:

  1. Check that the workspace belongs to the logged-in user. (Coder Connect only supports workspaces actually owned by the user.) If not, fallback to current behavior.
  2. Query api/v2/deployment/ssh to obtain the HostnameSuffix. If not set, fallback.
  3. Do a DNS lookup for an IPv6 address (AAAA record) for the workspace and agent as <agent>.<workspace>.me.<suffix>. If the DNS lookup fails (NXDOMAIN) or returns an address not in the prefix Coder Service Prefix fd60:627a:a42b::/48, fallback. Checking the prefix ensures that captive DNS portals that return addresses for any query are not false positives.
  4. If the DNS lookup was successful, this means Coder Connect is running, and the extension should connect to the workspace directly, rather than via the coder CLI, e.g. by directly initiating an SSH connection to <agent>.<workspace>.me.<suffix>.

ThomasK33 avatar Mar 06 '25 17:03 ThomasK33