Connects Rex clients and servers transparently via iroh. crates.io/crates/rex-iroh
Files
README.md

rex-iroh #

Connects Rex clients and servers transparently via iroh.

rex-iroh lets you use the Rex server on one machine from another, such as your desktop's terminals from your laptop or phone, without putting both on a VPN. It runs next to the Rex server on the machine you want to reach, and next to the rex command on each device you connect from. On both ends it talks to Rex through an ordinary Unix socket, so Rex itself needs no changes. It runs on Linux and macOS. Connections are end-to-end encrypted, and only devices you've paired can connect.

Quickstart #

On the machine running Rex:

rex-iroh serve      # leave this running
rex-iroh pair       # in another terminal; prints an invite and a QR code

On the other device:

rex-iroh join 'rexpair:?ticket=...&secret=...' --label "My laptop" --host desktop
# check the other device shows: intact protect dutch want answer

Check that both devices show the same five words, then answer y in the terminal running pair. join saves the machine it joined as desktop, and adds a Rex host by that name. Then start connect, which serves every machine you've joined, and use the host:

rex-iroh connect    # leave this running
rex -S desktop session ls

Documentation #

The book in docs/ covers installing, pairing, running serve as a service, managing paired devices, and what pairing a device allows it to do. Build and preview it with just book, which needs Nix.

PROTOCOL.md specifies the pairing and tunnel protocol, for anyone writing a compatible implementation.

License #

rex-iroh is licensed under either of MIT or Apache-2.0 at your option.