BYOC
Bring Your Own Computer

Your tab is the server.

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.

What it is

01 · HOST

A tab hosts a room

Call host() and you get a link. The room's logic runs right there in that tab, just like a game server would.

02 · JOIN

Friends open the link

Their tab calls connect() and gets a WebSocket-like connection to the host. Chat, game moves, cursors: whatever you send.

03 · CONNECT

BYOC does the networking

Introductions, NAT traversal, TURN, an encrypted relay as a last resort, reconnecting after reloads, and plain-English errors.

How it works

Host tab runs the room BYOC operator introduces peers Guest tab Guest tab encrypted signaling peer to peer (WebRTC) or TURN, or the operator's end-to-end encrypted relay when direct fails

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.

Get started

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.

Try it

Will it work on this network?

Checks the operator, WebRTC, and the direct and TURN paths from this browser. Takes about five seconds.

Operator…
WebRTC…
Direct (STUN)…
TURN…
Relay…

Good for, not for

Good for

  • Small groups, about 2 to 16 people
  • Real-time, session-length things: games, quiz nights, whiteboards, pair editing, "join my session"
  • Single-file and AI-made apps with no backend
  • Keeping data between the people using it

Not for

  • Large audiences or broadcast
  • Data that must outlive the host's tab
  • Games where the host must not be able to cheat (the host runs the rules)
  • Hosting from a phone in the background: the host's tab must stay open and visible

Security, briefly

Status

Pre-release (0.1). The protocol, operator and SDK work end to end and are tested in Chromium, Firefox and WebKit. Expect rough edges.

WhatWhere
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'] }).