BYOC turns a browser tab into a small real-time server. One person hosts from their tab, friends open a link, and everyone connects peer to peer. No backend to write, nothing to deploy, no account. The LAN party for the web.
Call host() and you get a link. The room's logic runs right there in that tab, just like a game server would.
Their tab calls connect() and gets a WebSocket-like connection to the host. Chat, game moves, cursors: whatever you send.
Introductions, NAT traversal, TURN, an encrypted relay as a last resort, reconnecting after reloads, and plain-English errors.
The operator is only a matchmaker. It helps the host's tab and each guest find each other, then the game or app traffic goes directly between browsers. When a network makes that impossible (strict NATs, some mobile carriers, office firewalls), BYOC falls back to TURN or to a relay that only ever sees ciphertext, automatically.
The host's link stays the same across reloads, and guests reconnect to their seats by themselves. When someone closes their tab, the others find out within seconds.
One HTML file, any static host (or localhost). The same page is the host or a guest, depending on the link:
<script type="module">
import { host, connect } from 'https://byoc.infinitefun.com/v0/byoc.js';
if (location.hash.includes('byoc=')) {
// Guest: the link is in the URL
const conn = await connect();
conn.onmessage = (e) => console.log(e.data);
conn.send('hi!');
} else {
// Host: this tab is the server
const room = await host();
room.onconnection = (conn) => {
conn.onmessage = (e) => room.broadcast(e.data); // your room logic
};
console.log('Share this link:', room.link);
}
</script>
A Connection works like a WebSocket
(send, onmessage, onclose,
readyState), so WebSocket code ports with few changes.
The whole API fits on one page: llm.md.
Building with an AI assistant? Point it at /llms.txt.
The classic six-player Tetris battle. Press Start Server, send the link, play. Keyboard only for now.
A chat room in one HTML file. Open it, then open the link it gives you in another browser or device.
Draw together. The host keeps the drawing and catches up anyone who joins late.
Checks the operator, WebRTC, and the direct and TURN paths from this browser. Takes about five seconds.
Pre-release (0.1). The protocol, operator and SDK work end to end and are tested in Chromium, Firefox and WebKit. Expect rough edges.
| What | Where |
|---|---|
| SDK (ES module, ~16 KB gzipped) | https://byoc.infinitefun.com/v0/byoc.js |
| Public operator (the default) | wss://api-byoc.infinitefun.com/v1, with STUN and TURN at api-byoc.infinitefun.com |
| API reference | /llm.md, /llms.txt |
| Wire protocol | /protocol.md |
The public operator is free and rate-limited, with no uptime promise yet.
You can run your own operator and pass
host({ operators: ['wss://your-operator/v1'] }).