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
Problem
Imagine a remote extension that spawns two processes: static html server and api server.
The extension can pass the localhost uri for the html server to openExternal and this will automatically establish port forwarding from the client machine to the target port on the remote machine. However the extension cannot currently open the port for the api server so the served up html will not be functional
Proposed API
Rather than letting extensions directly manage port forwarding, introduce a asExternalUri function that hides most of these details. This function would transparently establish port forwarding if it is required but would be a no-op for UI extensions or when VS Code is run locally.
Here's what this api could look like:
/** * Resolves a uri that points at a resource where the extension is running to a uri to the same resource on * the client machine. * * This is a noop if the extension is running locally * * If the extension is running remotely, this function establishes port forwarding from * the local machine to `target` on the remote and returns the local port for this connection * * Note that uris passed through `openExternal` are automatically resolved. */asExternalUri(target: Uri,): Thenable<Uri>;
In the remote case, the implementation of resolveUri would use VS Code's tunnel service to setup the port forwarding.
The text was updated successfully, but these errors were encountered:
mjbvz
changed the title
API — Let remote extensions expose a remote port the client machine
[API] Let remote extensions expose a remote port the client machine
Sep 19, 2019
mjbvz
changed the title
[API] Let remote extensions expose a remote port the client machine
[API] Let remote extensions expose a remote port to the client machine
Sep 19, 2019
Problem
Imagine a remote extension that spawns two processes: static html server and api server.
The extension can pass the localhost uri for the html server to
openExternal
and this will automatically establish port forwarding from the client machine to the target port on the remote machine. However the extension cannot currently open the port for the api server so the served up html will not be functionalProposed API
Rather than letting extensions directly manage port forwarding, introduce a
asExternalUri
function that hides most of these details. This function would transparently establish port forwarding if it is required but would be a no-op for UI extensions or when VS Code is run locally.Here's what this api could look like:
In the remote case, the implementation of
resolveUri
would use VS Code's tunnel service to setup the port forwarding.The text was updated successfully, but these errors were encountered: