Files
BetterDesk/docs/important/rdclient-protobuf-enum-encoding.md
T
UNITRONIX 1508c739b2 fix(api): Go :21114 default API and Node :21121 compat proxy (#160)
RustDesk clients could not log in after v3 when handlers moved to Go but
nothing listened on :21121 (API_ENABLED off) or Go bound the wrong port.
Go serves /api/login on 21114; the console proxies legacy :21121 URLs to
Go. Installers repair .env/systemd, Docker publishes both ports, and
firewall rules allow 21114 and 21121 on full installs.

Also includes betterdesk-support-agent (Fyne desktop helper) and
docs/important/ operator notes (API ports, update flow, agent roadmap).
2026-06-03 02:16:24 +02:00

16 lines
1019 B
Markdown

# rdclient protobuf enum encoding pitfall
- web-nodejs/public/js/rdclient/protocol.js `serializeMessage` MUST use
`Message.fromObject(obj)` (NOT `Message.create(obj)`) before `.encode()`.
- protobuf.js `create()` does NOT convert string enum names -> numeric values.
So `keyEvent.controlKey: 'Backspace'` / `mode: 'Legacy'` encoded as 0 (Unknown)
-> all non-character keys silently dropped by peer; only numeric `chr` letters worked.
- `fromObject()` converts enum name strings to numbers AND preserves Uint8Array
byte fields (clipboard content, file blocks, password, pk). Verified round-trip.
- Fixed in commit 1411719 (main).
- input.js KEY_MAP sends ControlKey NAME strings (Backspace/Return/Space/...).
ControlKey enum values: Backspace=2, Return=27, Space=30, Tab=31, Alt=1,
Control=4, Shift=29, Meta=23, Escape=8 (see protos/message.proto).
- Validate JS edits: `cd web-nodejs && node --check public/js/rdclient/<file>.js`.
- protobufjs not an npm dep; vendored at public/js/vendor/protobuf.min.js.