#!/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 "$@"