aboutsummaryrefslogtreecommitdiffstats
authorClayton Gentry <clayton@podstock.io>2026-08-14 00:46:31 -0400
committerClayton Gentry <clayton@podstock.io>2026-08-14 00:46:31 -0400
commite161eb5f6882c72ed07d35852747f2ac3bbaf1fa (patch)
treeb556c13e495dc856dfe841366e67dfe6c24baf53
parent81ecd3c87a1a1b2dcc4dc11e0371d5f460164481 (diff)
downloadcribd-e161eb5f68.tar.gz zip
Serve WebRTC streams on the local network
Add optional CRIBD_HOST support while keeping loopback as the default. Document LAN access and record the change.
Diffstat
CHANGELOG.md+1-0
README.md+10-2
bin/cribd+5-4
changelog/2026-08-13-local-network-viewing.md (new)+15-0
4 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
@@ -2,4 +2,5 @@
## 2026
+- **AUG.13** — [Local Network Viewing](changelog/2026-08-13-local-network-viewing.md)
- **AUG.13** — [RTSP to WebRTC](changelog/2026-08-13-rtsp-to-webrtc.md)
diff --git a/README.md b/README.md
@@ -7,7 +7,7 @@
## Status
-The current prototype runs on an Apple silicon Mac, serves one loopback-only stream, and uses MediaMTX's built-in viewer. Custom viewers, event adapters, remote access, persistence, and Raspberry Pi deployment come later.
+The current prototype runs on an Apple silicon Mac, serves one stream through MediaMTX's built-in viewer, and is loopback-only by default. It can also serve devices on the same local network. Custom viewers, event adapters, remote access, persistence, and Raspberry Pi deployment come later.
## Run locally
@@ -21,8 +21,16 @@
Open `http://localhost:8889/crib`. Use H.264 video with Opus, G722, PCMA, or PCMU audio for WebRTC playback.
-The launcher runs MediaMTX 1.20.0 and binds its WebRTC ports to loopback. Docker and Docker Compose are not required; `docker.io` is only the OCI image registry.
+To view from another device, use the Mac's LAN IPv4 address—not the camera's:
+```sh
+CRIBD_HOST=192.168.1.10 ./bin/cribd
+```
+
+Then open `http://192.168.1.10:8889/crib` from a device on the same network.
+
+The launcher runs MediaMTX 1.20.0 and binds its WebRTC ports to the selected address. Docker and Docker Compose are not required; `docker.io` is only the OCI image registry.
+
## Architecture
```text
diff --git a/bin/cribd b/bin/cribd
@@ -12,6 +12,7 @@
error "Apple's container CLI is required. Install container 1.0 or later."
project_dir=$(CDPATH= cd -- "${0%/*}/.." && pwd)
+host=${CRIBD_HOST:-127.0.0.1}
if [ "${CRIBD_RTSP_URL+x}" != x ] && [ -f "$project_dir/.env" ]; then
. "$project_dir/.env"
@@ -23,13 +24,13 @@
*) error "CRIBD_RTSP_URL must use rtsp:// or rtsps://." ;;
esac
-unset CRIBD_RTSP_URL
+unset CRIBD_RTSP_URL CRIBD_HOST
container system start
exec container run --rm --name cribd-media \
--env "MTX_PATHS_CRIB_SOURCE=$rtsp_url" \
- --env "MTX_WEBRTCADDITIONALHOSTS=127.0.0.1" \
- --publish "127.0.0.1:8889:8889/tcp" \
- --publish "127.0.0.1:8189:8189/udp" \
+ --env "MTX_WEBRTCADDITIONALHOSTS=$host" \
+ --publish "$host:8889:8889/tcp" \
+ --publish "$host:8189:8189/udp" \
docker.io/bluenviron/mediamtx:1.20.0
diff --git a/changelog/2026-08-13-local-network-viewing.md b/changelog/2026-08-13-local-network-viewing.md
@@ -0,0 +1,15 @@
+# Local Network Viewing
+
+Date: **AUG.13.2026**
+
+`cribd` serves its WebRTC player to devices on the local network.
+
+Set `CRIBD_HOST` to the development Mac's LAN address:
+
+```sh
+CRIBD_HOST=192.168.1.10 ./bin/cribd
+```
+
+Open `http://192.168.1.10:8889/crib` from another device on the same network.
+
+The launcher binds MediaMTX's WebRTC HTTP and UDP ports to the configured address and advertises it to WebRTC clients. Without `CRIBD_HOST`, access remains loopback-only. Remote access, authentication, and TLS are not included.