SSH-like remote sessions for AI coding harnesses (pi, codex, claude).
One daemon per host, TLS-encrypted, password auth, backed by tmux so
sessions survive disconnects.
muxy create desktop pi-1 /root/projects/bot # create + attach
muxy connect desktop pi-1 # re-attach
muxy list desktop # list sessions
muxy delete desktop pi-1 # kill sessionDetach with Ctrl-] — the session keeps running on the host.
Requires Go 1.24+ to build, and tmux on every host.
go build -o muxy .
cp muxy /usr/local/bin/muxy # sudo if neededOn each host (e.g. desktop):
sudo muxy setup # password, TLS cert, /etc/muxy/config.yaml
sudo muxy daemon # or deploy/muxy.service via systemdsetup prompts for a password (stored as bcrypt hash only), generates a
self-signed cert, and validates tmux + harness binaries. Harness
name → binary mappings live in /etc/muxy/config.yaml:
harnesses:
pi: { binary: /root/.nvm/versions/node/v24.21.0/bin/pi }
codex: { binary: /usr/local/bin/codex }muxy add-host desktop 192.168.1.50
muxy create desktop pi-1 # harness inferred from pi-*
muxy create desktop pi-1 /root/projects/bot # run in a host directory
muxy create desktop scratch --harness pi -- --model opus
muxy connect desktop pi-1
muxy list desktop
muxy delete desktop pi-1- Password is prompted every time (never in argv/env/logs).
- First connect shows the server cert fingerprint — verify, accept once,
it's pinned in
~/.config/muxy/known_hosts.yaml. muxy create --no-attachcreates in the background without attaching.
The daemon also serves a WebSocket endpoint for HTTP reverse proxies
(Caddy, nginx, Cloudflare). Raw TCP :7222 keeps working alongside it.
Server config adds:
ws_listen: ":7223" # WSS endpoint, same cert; "" disables
ws_path: /muxyPoint your proxy at https://<daemon>:7223/muxy (self-signed upstream,
skip-verify) and pair clients with the public URL:
muxy add-host desktop-remote --url wss://muxy.example.com/muxy
muxy list desktop-remote
muxy create desktop-remote pi-1 /root- One muxy frame = one WS binary message. No compression (jitter),
PTY output coalesced in ~5ms windows, ping every 20s so proxies don't
idle-kill sessions.
GET /healthzfor proxy health checks. - Trust: system roots first (real proxy cert → no prompt), TOFU pin
fallback for direct
wss://to the self-signed daemon. - Rate-limiting uses
X-Forwarded-Forwhen present. - See
deploy/Caddyfile.exampleanddeploy/nginx-muxy.conf.example. TLS here is hop-by-hop: the proxy terminates the outer TLS.
- TLS 1.3, self-signed cert, TOFU pinning (SSH-style). Fingerprint change aborts with a warning.
- Password sent inside TLS only, bcrypt-verified, rate-limited (5 fails → 30s lockout per IP).
- Session names validated; tmux invoked via argv (no shell).
cmd/— CLI (setup,daemon,create,connect,list,delete)internal/daemon— TLS server, auth, tmux bridginginternal/client— dial, TOFU, raw-terminal attachinternal/proto— frame protocol (JSON hello + PTY byte stream)internal/frameconn— transport abstraction: raw TCP/TLS or WebSocket (one muxy frame per WS binary message)internal/tmux— tmux argv wrapperinternal/auth— bcrypt + lockout trackerinternal/tlscert— self-signed cert generationdeploy/— systemd unit + launchd plist
go vet ./... && go test ./...