bridgesessions
Single binary containing client, server, and doctor. Static-linked OpenSSL + zstd, ~5 MB.
One protocol. One binary. One mesh. Replace mosh → ssh → zellij with bs-client ⚡ bs-server.
BridgeSessions is written in C++23, uses TLS 1.3 over TCP for transport, zstd per-frame compression, and ed25519 mutual TLS plus TOFU for authentication. The build system is CMake 3.25+.
┌─────────────────────────────────────────────────────────────────┐
│ macOS / Linux / Windows client │
│ ┌─ Pane A ───────────────────────────┐ ┌─ Pane B ───────────┐│
│ │ bridgesessions shell dev --name=hms │ │ bridgesessions ... ││
│ │ stdin/stdout relay │ │ ││
│ └──────────────┬──────────────────────┘ └──────────┬─────────┘│
└──────────────────┼────────────────────────────────────┼──────────┘
│ bs:// over TLS 1.3 / TCP (19949) │
┌────────┴──────────┐ ┌─────────┴──────────┐
│ INTERNET │ │ │
└────────┬──────────┘ └─────────┬──────────┘
│ │
┌──────────────────┼────────────────────────────────────┼──────────┐
│ Linux / macOS server │
│ bridgesessions (daemon, TCP 19949) │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Session Multiplexer (replaces zellij) │ │
│ │ ┌─ session: hms ──────────────────────────────────┐ │ │
│ │ │ PTY → shell │ │ │
│ │ │ Output buffer (zstd, last 16K lines) │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ │ Clipboard relay (OSC 52 → protocol message) │ │
│ └──────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────┘
The client is a relay, not a terminal emulator. It sits between the local PTY and the network, translating stdin/stdout to and from bs:// protocol messages.
Single binary containing client, server, and doctor. Static-linked OpenSSL + zstd, ~5 MB.
Stdin/stdout relay. Loads the ed25519 keypair, dials the server, performs mTLS, and attaches to a named session.
Linux/macOS daemon. Manages PTY lifetimes, buffers output, forwards signals, and relays clipboard.
Shared message types, binary codec, and zstd compression. Header-only where possible.
TLS 1.3 over TCP v1. Future v2 swaps to QUIC via msquic with the same protocol codecs.
Web surface for long Markdown reviews. Edit, Save, Copy — not chat paste.
bs:// protocolReliable, secure, compressed, low-latency, firewall-friendly, and multiplexed.
Frame: [stream_id: u16] [type: u8] [flags: u8] [length: u16] [data] flags: bit 0 = compressed (zstd), bit 1 = control frame Stream ID 0: Control channel (Attach, Detach, SessionList, Ping/Pong) Stream ID 1-N: Session channels (Keystroke, Output, Clipboard, Signal)
Raw key bytes to the server; PTY stdout back to the client.
Start or preserve a session. Detach keeps the PTY alive.
Two-way clipboard with hash echo to prevent races.
Replay last output in paced, client-ACK'd chunks.
Forward ^C, ^Z, and ^\ to the foreground process group.
Notify the client when a PTY exits or a foreground process ends.
Application: bs:// protocol messages
Transport: TLS 1.3 over TCP
├── Forward secrecy (X25519 key exchange)
└── TLS session tickets (ephemeral)
Compression: zstd per-frame
Identity: ed25519 keypair (no CA infrastructure needed)
Authentication uses ed25519 mutual TLS plus TOFU. Each client has a keypair stored in ~/.bridgesessions/id_ed25519.pem. Servers pin authorized public keys in ~/.bridgesessions/authorized_keys.