gh-net
gh-net copied to clipboard
Epic: [api]: add `RPC` API
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 thegh netextension as binary inrawmode. Such mode would use the pipe provided to run the RPC server on. The VScode extension will use thepipeforRPC clientconnection. - [ ] [TBD] means to get a tunnel to the codespace, can be provided by vscode extension as another
pipe, aTCPport orstdiostream. - [ ] VSCode extension that will use the new
RPCAPI 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 netextension and the lifecycle ofgh netextension itself - [ ] implement UI and network bridge control logic thru the
RPCclient