const peer = new Peer(
`${Math.floor(Math.random() * 2 ** 18)
.toString(36)
.padStart(4, 0)}`,
{
host: location.hostname,
debug: 1,
path: "/myapp",
},
);Connecting the peers / notebook
Connecting the peers
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
window.peer = peer;