Repository navigation
Connect browser SSH through metro-api - #307
Open
sjmiller609 wants to merge 1 commit into
Open
sjmiller609 wants to merge 1 commit into
sjmiller609 wants to merge 1 commit into
Conversation
sjmiller609
marked this pull request as ready for review
October 31, 2026 15:27
Contributor
Author
|
Picked rgarcia to review: recent commits in |
rgarcia
approved these changes
Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kernel browsers sshnow tunnels through metro-api's/browser/sshroute instead of the VM's public2222endpoint./browser/cdpreplaced by/browser/ssh.--setup-onlyoutputs. TheProxyCommandURL is single-quoted because ssh runs it through a shell and the URL contains?. The printedsshcommand wraps it in double quotes.2222, and metro-api forwards to it. The JSON output keeps all its fields, includingvm_domain.Going through metro-api means connecting wakes a browser that's in standby, and an open SSH connection keeps it out of standby, including while the shell is idle.
Rollout
Requires the metro-api
/browser/sshroute (kernel/kernel#5144) to be deployed on every metro before release. Older CLI versions keep using public2222until it is retired.--setup-onlycommands now include the session JWT in the websocat URL, so they're valid only for as long as that JWT is.Testing
go build ./...,go vet ./cmd/... ./pkg/ssh/,go test ./pkg/ssh/ ./cmd/kernel browsers ssh <id>ran a remote command through/browser/ssh.--setup-only -o jsonssh_command, run throughbash -c, connected and ran a command.-L) to the guest's CDP HTTP endpoint returned/json/version.Note
Medium Risk
Changes how users reach browser VMs and depends on metro-api
/browser/sshbeing deployed; setup-only commands now embed session JWTs with limited lifetime.Overview
kernel browsers sshno longer openswebsocatto the VM’s public:2222endpoint. It builds a metro-api SSH WebSocket URL from the browser CDP URL (same host, path prefix, and session JWT;/browser/cdp→/browser/ssh) and uses that for the interactive session and for--setup-only/ JSONproxy_command/ssh_commandoutput.Shared helpers
ProxyURL,ProxyCommand, and an updatedBuildSSHCommand(proxyURL, …)centralize thewebsocat --binary '…'proxy (single-quoted URL for shell-safeProxyCommand). VM-side setup is unchanged; metro still forwards to the guest bridge on private 2222. Troubleshooting text now points at metro reachability instead of port 2222.Unit tests cover URL derivation edge cases and the generated
sshargument list.Reviewed by Cursor Bugbot for commit 99b92ea. Bugbot is set up for automated code reviews on this repo. Configure here.