open-standards/wai/examples/remote-desktop/host.sh
Transaction Science c86b75ac52 The service binaries are wai-relay, wai-room and wai-ingest; the crates keep their names
WAI toolchain decision 11: joule-moq-relay builds wai-relay, joule-moq-room wai-room, and
joule-moq-ingest wai-ingest. wai dev finds them by those names (WAI_RELAY_BIN, WAI_ROOM_BIN),
and the quickstart archive, the release workflow, the examples' workflow, the browser
tests, the interop scripts, the example host script, the Scoop manifest and the crates'
READMEs and example configurations name them so. Wire and record identifiers that carry a
crate's name (joule-moq-relay/session-summary/2, joule-moq-ingest/session/1, the relay's
MOQT implementation string) and the log variables (JOULE_MOQ_*_LOG) are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 04:52:31 -04:00

22 lines
1.1 KiB
Shell
Executable file

#!/bin/sh
# Share this machine's screen into the room `wai dev` runs here, as its host.
#
# sh host.sh the display (the system asks once for permission to record it)
# sh host.sh --pattern a drawn test pattern instead: needs no permission and no display
# sh host.sh ... --seconds 30 --record session.json any other wai-remote-host option
#
# The host's key is made once, in host.key (mode 0600). The invitation is signed by the room's
# authority from `wai dev`'s keys, and binds the room to the first key that presents it. This
# host hands control to whoever asks for it (--give-on-request), as a demonstration does.
set -eu
ORIGIN=${WAI_DEV_ORIGIN:-http://127.0.0.1:8080}
[ -f host.key ] || wai-remote-host key host.key > /dev/null
INVITATION=$(wai-room invite .wai/dev/room-keys.toml 3600)
SOURCE=display
if [ "${1:-}" = "--pattern" ]; then
SOURCE="pattern --encoder ipcm"
shift
fi
# shellcheck disable=SC2086
exec wai-remote-host run --room "$ORIGIN/room-api" --key host.key --invitation "$INVITATION" \
--relay "ws://${ORIGIN#http://}/moq" --give-on-request --source $SOURCE "$@"