zenohd router with the
zenoh-plugin-remote-api enabled bridges native Zenoh peers
and browser clients.
tcp/127.0.0.1:7447.
ws/127.0.0.1:10000 and subscribes to the key
demo/zenoh-demo; whenever the publisher goes up or down
the status badge follows.
This page is served from zjin.pages.dev but talks to a
zenohd router running on your own machine
(ws://127.0.0.1:10000). Recent versions of Chromium-based
browsers treat that as a local network request and will pop up a
permission prompt the first time, similar to:
zjin.pages.dev wants to access other apps and services on
this device.
You must click Allow for the demo to work; clicking Block will prevent the page from reaching your local router and the router badge above will stay offline. If you accidentally blocked it, open the lock / tune icon in the address bar, reset the site permission, and reload.
Install zenohd and the Remote-API plugin from the Eclipse
Zenoh apt repository:
echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" \
| sudo tee /etc/apt/sources.list.d/eclipse-zenoh.list
sudo apt-get update
sudo apt-get install -y zenoh zenoh-plugin-remote-api
Install the Python binding into a venv:
python3 -m venv ~/Downloads/zenoh-demo/venv
~/Downloads/zenoh-demo/venv/bin/pip install eclipse-zenoh
Start the router (terminal 1):
zenohd \
--cfg='listen/endpoints:["tcp/0.0.0.0:7447"]' \
--cfg='plugins/remote_api/websocket_port:"10000"'
Start the publisher (terminal 2, see the Python code):
~/Downloads/zenoh-demo/venv/bin/python \
code/python/middleware/zenoh_pub.py --name alice --message hello