demo · v144
TTL & Loop Explorer
Multicast UDP has two knobs every author gets wrong: ttl (how many router hops the packet survives) and loopback (whether the sender also receives a copy on the same host). Dial each one and the topology shows which subnets the packet reaches.
Behind a flag — Direct Sockets is Isolated Web App only. The send call below is illustrative; the visualisation below simulates the routing rule.
UDPSocket: checking…
send parameters
topology
each box is a router/host. The packet hops outward until TTL = 0.
- hops reached
- 0
- dropped at
- —
- sender copy
- —
the API
// IWA only: create a multicast-capable UDP socket
const sock = new UDPSocket({
remoteAddress: "224.0.0.251",
remotePort: 5353,
multicast: {
ttl: 1, // 1 = local subnet only
loopback: true, // receive own packets
interface: "192.168.1.10", // bind to this NIC
join: ["224.0.0.251"] // subscribe
}
});
const { writable, readable } = await sock.opened;
await writable.getWriter().write({ data: encoded });