wurl
curl for WebRTC: join any relay as a peer from the command line, and see every step of the connection.
Use
git clone https://github.com/draeder/wurl && cd wurl
npm install && npm link # puts `wurl` on your PATH (Node 20+)
wurl -d "hello" "https://decentralize.ooo/?network=network:test&room=room-1"It connects to the site's relay, announces itself in the network and room from the URL, finds the peers there, opens real WebRTC connections to them, and exchanges data, reporting each step with its time, the way curl -v reports DNS, TLS and HTTP:
* [0.02s] relay connected
* [0.02s] registered and announced in network:test / room-1
* [0.02s] found 1 peer(s): 42317db2 (1 so far)
> [0.02s] offer to 42317db2
* [0.42s] data channel open with 42317db2 after 0.40sIt uses FreeRTC's own client, so it does exactly what a browser does; WebRTC comes from werift.
Options
| Option | |
|---|---|
-n, --network, -r, --room | The network and room (otherwise from ?network= and ?room=) |
--signal <url> | A relay to use instead of the one the URL implies |
-p, --peers <n> | Run n peers in one process |
-c, --connect <n> | Connections each peer dials, at most (default 4) |
-t, --time <s> | Longest run (default 20 s) |
-d, --data <text> | Send this on each data channel when it opens |
-m, --messages | Run the peers as PeerPigeon nodes: broadcasts and routed direct messages |
-v, -s, --json | More detail, only the summary, or the summary as JSON |
Exit codes follow curl: 0 connected, 6 relay unreachable, 7 signaling failed, 52 alone in the room, 28 peers found but none connected.
Mesh tests
Large tests belong on a local relay with federation off: every peer's signaling counts against a public relay's daily limit, so wurl refuses more than 5 peers against a public relay unless you add --public-load.
wurl -p 50 -t 60 --signal ws://127.0.0.1:8788/ws "https://decentralize.ooo/?network=network:test&room=load-1"