dart_mosh library

Dart building blocks for launching and speaking the Mosh mobile shell protocol.

The package owns the Mosh UDP transport. Applications still own SSH, terminal rendering, and process lifecycle.

Classes

AesOcb
Pure Dart AES-OCB implementation compatible with stock mosh-server.
MoshAead
Authenticated encryption used by the Mosh packet cipher.
MoshCipher
Encrypts and decrypts complete Mosh UDP packets.
MoshClientInstruction
Base class for client instructions sent inside a Mosh user message.
MoshFragment
A single Mosh fragment carrying part of a compressed transport instruction.
MoshFragmentAssembly
Reassembles Mosh fragments into complete payloads.
MoshHostMessage
Decoded host output and echo acknowledgement message.
MoshKey
A 128-bit printable Mosh session key.
MoshKeystroke
Client keystroke instruction.
MoshNonce
Mosh packet nonce in wire and AEAD forms.
MoshPacketCipher
Mosh packet cipher that prepends the 8-byte wire nonce to each packet.
MoshReplayFilter
MoshResize
Client terminal resize instruction.
MoshRttEstimator
MoshServerConfig
Connection details parsed from a MOSH CONNECT line.
MoshSession
UDP Mosh session for terminal input, output, acknowledgements, and rehoming.
MoshSshBootstrap
Builds the SSH command used to start mosh-server.
MoshTransportInstruction
Mosh transport instruction carrying state numbers, diffs, and chaff.
MoshTransportPacket
Mosh transport packet header plus one encrypted payload fragment.
MoshUserMessage
Client message containing one or more instructions.

Functions

moshCompress(List<int> data) Uint8List
Compresses a Mosh transport instruction payload with zlib.
moshDecompress(List<int> data) Uint8List
Decompresses a zlib-compressed Mosh transport instruction payload.
moshFragments(int id, Uint8List payload, int mtu) List<MoshFragment>
Splits payload into Mosh fragments with up to mtu content bytes each.

Exceptions / Errors

MoshException
Exception thrown when Mosh parsing, framing, or cryptography fails.