morsh-0.4.0 is not a library.
morsh
morsh is a next-generation remote terminal and shell over QUIC and TLS 1.3, combining the responsiveness and roaming resilience of Mosh with the versatility, tunneling, and authentication flexibility of OpenSSH.
Features
- QUIC & TLS 1.3 Transport: Multiplexed bidirectional streams over UDP with TLS 1.3 encryption, eliminating head-of-line blocking and providing single-RTT connection establishment.
- Connection Migration & IP Roaming: Seamlessly roam between Wi-Fi, Ethernet, and cellular networks without dropping active sessions.
- Predictive Local Echo: Speculative keystroke rendering with ANSI styling (dim/underline) and 1-RTT server divergence rollback, eliminating perceived latency on high-RTT links.
- Session Persistence & Screen Recovery: Server-side virtual terminal emulator (
vt100) tracks screen state and cursor coordinates. Detach voluntarily (Ctrl-^ d) or recover from connection drops instantly via 128-bit cryptographic session tokens. - TCP Fallback & Happy Eyeballs: RFC 8305 connection racing automatically selects QUIC/UDP or seamlessly falls back to multiplexed TLS 1.3 over TCP in UDP-restricted network environments.
- Port Forwarding & Tunnels:
- Local TCP forwarding (
-L [bind:]port:host:hostport) - Remote TCP forwarding (
-R [bind:]port:host:hostport) - Dynamic SOCKS5 proxy (
-D [bind:]port) - Native UDP datagram forwarding (
-U [bind:]port:host:hostport) - Tunnel-only mode (
-N/--no-shell)
- Local TCP forwarding (
- Stealth Security & Handshake Authentication:
- Stealth Knock protection (SSH3-style URL path validation to reject unauthorized port scanners)
- OpenSSH
authorized_keysparsing with Ed25519, ECDSA, and RSA signature verification - UNIX domain socket
ssh-agentintegration - Linux PAM password verification
- OpenSSH CLI & Configuration Parity:
- OpenSSH flag compatibility (
-p,-i,-F,-o,-C,-4,-6,-v) - Client configuration in
~/.morsh/config.tomlwith DP wildcard pattern matching, negations (!pattern), and host aliases - Server configuration in
/etc/morsh/morshd.tomlwith dynamic SIGHUP configuration reload
- OpenSSH flag compatibility (
Installation
From crates.io
Install the client CLI:
Install the server daemon:
Quick Start
1. Start Server Daemon (morshd)
Run with ephemeral self-signed certificates:
Or run with stealth knock path protection and explicit certificates:
2. Connect with Client (morsh)
Connect to a remote server:
Using OpenSSH key and stealth knock path:
Detaching and resuming sessions:
- Press
Ctrl-^ dinside the shell to detach without killing remote processes. - Re-run
morsh user@example.com:2222to resume the persistent session with instant screen state recovery.
Port forwarding and SOCKS5 proxy:
# Dynamic SOCKS5 proxy on local port 1080
# Forward local port 8080 to remote Postgres 5432
Workspace Architecture
| Crate | Purpose |
|---|---|
morsh |
Interactive client CLI binary with terminal raw mode and config resolution |
morshd |
Server daemon binary multiplexing PTY, auth, tunnels, and sessions |
morsh-core |
Binary wire protocol framing, Postcard serialization codecs, and constants |
morsh-transport |
Multiplexed QUIC (Quinn) and TCP transport with Happy Eyeballs auto-detection |
morsh-auth |
SSH key parsing (Ed25519/ECDSA/RSA), ssh-agent, PAM, and stealth knock verification |
morsh-term |
PTY supervisor (portable-pty), TIOCSWINSZ resizing, and vt100 state buffer |
morsh-predict |
Speculative local echo engine, visual ANSI styling, and 1-RTT divergence rollback |
morsh-tunnel |
Local/remote TCP forwarding, SOCKS5 proxy engine, and UDP datagram bridging |
License
Licensed under the Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).