gh-net icon indicating copy to clipboard operation
gh-net copied to clipboard

Epic: [api]: add `RPC` API

Open legomushroom opened this issue 3 years ago • 1 comments

Add RPC API for the extension that will allow using the extension by other tools as a standalone binary. For instance, a vscode extension could use the RPC API to set up the network bridge for a specified Codesapce and control its logic, like allowed DNS names or IP addresses list. This API also needs to provide a channel for UI notifications to be able to replace the current terminal GUI with a vscode UI completely.

Adding such RPC surface involves:

  • [ ] the RPC services to allow for DNS, IP routing control, and app state change notifications.
  • [ ] JSON schema for RPC API, which can be used to generate types/helpers for other programming languages.
  • [ ] Typescript types/helpers generated out of the JSON schema above to interface with the CLI extension RPC surface.
  • [ ] new --rpc-pipe(or similar name) argument for the CLI that will launch the gh net extension as binary in raw mode. Such mode would use the pipe provided to run the RPC server on. The VScode extension will use the pipe for RPC client connection.
  • [ ] [TBD] means to get a tunnel to the codespace, can be provided by vscode extension as another pipe, a TCP port or stdio stream.
  • [ ] VSCode extension that will use the new RPC API to create the network bridge:
    • [ ] automatically get the binaries for the current machine
    • [ ] [TBD] provides the way to leverage a tunnel on the existing connection to a Codespace
    • [ ] manage the lifecycle of the pipes required for the gh net extension and the lifecycle of gh net extension itself
    • [ ] implement UI and network bridge control logic thru the RPC client

legomushroom avatar Jun 21 '22 21:06 legomushroom