Skip to content

No port forwarding for "code serve-web" when accessed from another machine #316209

Open

Description

@DanTup

On another machine on my network, I ran:

code serve-web --host 0.0.0.0 --port 9000

This serves the web version of VS Code and I can access it from my own machine (by using the other machines IP address/hostname).

However, extension calls to vscode.env.asExternalUri() with a localhost URI to not get forwarded or mapped in any way, so the extension tries to load webviews with localhost URLs that fail on the client machine.

VS Code knows the correct host/IP being used to access the UI (vscode.env.remoteName shows the name of the other machine which I'm using in the address bar) so I would've thought it could forward the port and rewrite the URL (at least behind a CLI flag).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions