← All projects
Project record1 mention
Originally shared on Hacker News

Relaynet

Relaynet is an open-source, self-hostable relay that gives browser tabs a real network: pages send raw Ethernet frames over a WebSocket, and the relay provides DHCP, DNS, and NAT for IPv4 TCP and UDP, with sessions from the same account sharing a private network. It ships an npm client library (relaynet), Apache-2.0 code with an MIT relay engine forked from rootlessRelay, self-hosting via docker compose with accounts, API tokens and an operator panel, and a hosted instance at https://relaynet.network.

Last shared For Anyone building browser-based VMs, shells, debuggers or emulators
01 / The problem

What it addresses

Browsers can't open a TCP socket, which repeatedly affects anything that brings its own network stack into a tab, such as emulated VMs, WebAssembly builds of an OS, and user-space TCP/IP stacks like smoltcp or lwIP; the submitter kept writing one-off relays for these before building this one.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Relaynet

    Relaynet is an open-source, self-hostable relay that gives browser tabs a real network: pages send raw Ethernet frames over a WebSocket, and the relay provides DHCP, DNS, and NAT for IPv4 TCP and UDP, with sessions from the same account sharing a private network. It ships an npm client library (relaynet), Apache-2.0 code with an MIT relay engine forked from rootlessRelay, self-hosting via docker compose with accounts, API tokens and an operator panel, and a hosted instance at https://relaynet.network.

    Problem: Browsers can't open a TCP socket, which repeatedly affects anything that brings its own network stack into a tab, such as emulated VMs, WebAssembly builds of an OS, and user-space TCP/IP stacks like smoltcp or lwIP; the submitter kept writing one-off relays for these before building this one.

    Audience: Anyone building browser-based VMs, shells, debuggers or emulators

    Posted by @jonathanberi · Original source ↗

    Story title · @jonathanberi · · Source ↗

    Show HN: Relaynet – open-source relay that gives browser tabs a real network

    Submitted URL · @jonathanberi · · Source ↗

    https://github.com/beriberikix/relaynet

    Source text · @jonathanberi · · Source ↗

    Browsers can't open a TCP socket. That keeps biting anything that brings its own network stack into a tab: emulated VMs, WebAssembly builds of an OS, user-space TCP/IP like smoltcp or lwIP. I kept writing one-off relays for these, so I built a proper one and have now open-sourced it.

    Source text · @jonathanberi · · Source ↗

    How it works: the page sends raw Ethernet frames over a WebSocket. The relay gives it a DHCP lease and DNS, and NATs IPv4 TCP and UDP out to the internet. Sessions from the same account share a private network, so two VMs in two tabs can reach each other. A small client library (npm: relaynet) handles reconnects and heartbeats.

    Source text · @jonathanberi · · Source ↗

    Self-hosting is the main point of this release: git clone https://github.com/beriberikix/relaynet cd relaynet && docker compose up That runs the relay and the site with accounts, API tokens and an operator panel. It needs no third-party services.

    Source text · @jonathanberi · · Source ↗

    License: Apache-2.0. The relay engine is MIT, a fork of rootlessRelay that adds accounts, orgs, quotas and metering.

    Source text · @jonathanberi · · Source ↗

    There's also a hosted instance at https://relaynet.network with a free tier, if you just want to try a client against it. A Zephyr RTOS build in an x86 emulator is a quick no-account demo: https://beriberikix.github.io/zephyr-v86/

    Source text · @jonathanberi · · Source ↗

    Most interested in hearing from anyone building browser-based VMs, shells, debuggers or emulators, and what breaks.