7 Commits
Author SHA1 Message Date
zhanglq e17b92cd9d fix: prevent Mosh character ghosting caused by overlapping diffs
- client.go: track last output oldNum, replace instead of append when same base
- transport.go: reject diffs that do not chain from latest acknowledged state
  (oldNum != ackNum), preventing stale ANSI sequences from corrupting output
2026-07-02 21:01:24 +08:00
realrasengan f70f18fc3f add DialConnRaw + RecvRaw for direct transport access in WASM 2026-03-30 20:55:37 -07:00
realrasengan b71a9c5824 fix key repeat: only create new state when previous is acked (match Dart client)
The Dart mosh client only calls sendNew() when hasPendingState is false.
The Go client was calling SetPending on every tick with dirty=true, which
reset diffSent and caused new sequence numbers for the same cumulative
payload. Now tick() checks AckedByRemote >= SentNum before calling
SetPending — at most one unacked state in flight, matching the Dart
client's behavior.
2026-03-30 19:56:45 -07:00
realrasengan 5f8cade139 add Tick() export and DialConnManual for JS-driven send loop in WASM 2026-03-30 14:24:44 -07:00
realrasengan bbe416444b add Conn interface, WASM client with WebTransport transport
- Conn interface: abstracts datagram I/O (Read/Write/SetReadDeadline/Close)
- Client.DialConn(): create client over any Conn (not just UDP)
- cmd/mosh-wasm: WASM binary exposing moshConnect(url, key) to JS
- WebTransport adapter: browser datagrams as mosh.Conn
- Build tags: server.go and framebuffer.go excluded from js/wasm
- Shared constants moved to conn.go

Existing UDP paths unchanged. Latch unaffected.
2026-03-30 12:05:33 -07:00
realrasengan 0f15d99fbc transport: SSP state tracking for framebuffer ack
Add AckedByRemote/SentNum accessors, diffOldNum locking, and
received state list for proper old_num validation. Required for
server framebuffer diffing to track which state the client has.
2026-03-14 20:40:53 -07:00
realrasengan bb08f71e30 Initial release: pure Go mosh client and server
Wire-compatible with C mosh. AES-128-OCB3, SSP transport, fragmentation,
protobuf state sync, latch extension fields.

Includes ServeRW bridge mode for embedding.
2026-03-12 18:33:41 -07:00