| .. | ||
| cmd/cmuxd-remote | ||
| go.mod | ||
| README.md | ||
cmuxd-remote (Go)
Go remote daemon for cmux ssh bootstrap, capability negotiation, and CLI relay.
Commands
cmuxd-remote versioncmuxd-remote serve --stdiocmuxd-remote cli <command> [args...]— relay cmux commands to the local app over the reverse TCP forward
When invoked as cmux (via symlink created during bootstrap), the binary auto-dispatches to the cli subcommand. This is busybox-style argv[0] detection.
RPC methods (newline-delimited JSON over stdio)
helloping
CLI relay
The cli subcommand (or cmux symlink) connects to the local cmux app's socket through an SSH reverse TCP forward and relays commands. It supports both v1 text protocol and v2 JSON-RPC commands.
Socket discovery order:
--socket <path>flagCMUX_SOCKET_PATHenvironment variable~/.cmux/socket_addrfile (written by the app after the reverse relay establishes)
For TCP addresses, the CLI retries for up to 15 seconds on connection refused, re-reading ~/.cmux/socket_addr on each attempt to pick up updated relay ports.
Integration in cmux
workspace.remote.configurebootstraps this binary over SSH when missing.- Client sends
hellobefore enabling remote port probing/forwarding. - Daemon status/capabilities are exposed in
workspace.remote.status -> remote.daemon. - Bootstrap creates
~/.cmux/bin/cmuxsymlink pointing to the daemon binary. - A background
ssh -N -Rprocess reverse-forwards a TCP port to the local cmux Unix socket. The relay address is written to~/.cmux/socket_addron the remote.