Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jossephus/chuchu/llms.txt

Use this file to discover all available pages before exploring further.

Mosh (mobile shell) replaces the SSH transport layer with a UDP-based protocol that handles packet loss and network changes gracefully. When your Android device switches from Wi-Fi to LTE — or your connection drops briefly — a Mosh session resumes where it left off without any reconnection prompt. Chuchu uses Transport.Mosh to bootstrap a Mosh session automatically: it connects over SSH, starts mosh-server, parses the connection handshake, then hands off to the native Mosh client.

Prerequisites

mosh-server must be installed on the remote host. On most Linux distributions:
# Debian / Ubuntu
apt install mosh

# macOS (Homebrew)
brew install mosh

How the Mosh bootstrap works

When you connect with Transport.Mosh, Chuchu performs a two-phase setup:
  1. SSH bootstrap — Chuchu opens a standard SSH connection to your server using the auth method you configured (password or key). This is the same libssh2 path used by Transport.SSH.
  2. Start mosh-server — Chuchu sends the following command over the SSH shell:
    mosh-server new -s -c 256 -l LC_ALL=en_US.UTF-8
    
  3. Parse the handshake — The server responds with a line like MOSH CONNECT <port> <key>. Chuchu’s MoshBootstrapParser extracts the UDP port and 22-character session key from that output.
  4. Switch to Mosh — Chuchu closes the SSH connection and starts the native Mosh client, connecting to the server over UDP using the port and key from step 3.
  5. Mosh takes over — The Mosh client handles all subsequent reconnection transparently at the protocol level.

Add a Mosh server

1

Install mosh-server on the remote host

Run apt install mosh (or the equivalent for your OS) on the server you want to connect to.
2

Add a new server in Chuchu

Tap + on the server list. Enter your Host, Port, and Username as normal.
3

Set the transport to Mosh

Set Transport to Mosh.
4

Configure authentication

Choose Password or Key authentication — Mosh uses the same auth methods as SSH for the bootstrap phase. Fill in the password or select an SSH key.
5

Connect

Tap Save, then tap the server. Chuchu bootstraps via SSH and switches to Mosh UDP automatically.
Mosh uses UDP for its transport, typically on port 60001 and above. Make sure your server’s firewall allows inbound UDP traffic on those ports. If mosh-server isn’t found on the remote host, Chuchu will show a bootstrap error rather than opening a session.
Mosh is especially useful on mobile networks. Sessions survive switching between Wi-Fi and LTE, and the Mosh protocol masks latency and packet loss — making remote editing or long-running commands feel far more responsive than standard SSH on a mobile connection.

Reconnection behavior

Mosh handles reconnection at the protocol level — if your network drops, the Mosh client continues retrying in the background and resumes the session when connectivity returns. Chuchu also has its own reconnect logic (exponential backoff, up to 8 attempts) which kicks in if the Mosh session itself terminates unexpectedly.

Build docs developers (and LLMs) love