The LAN relay brokers WebRTC peer-to-peer signaling between a browser hosting a LAN world and the clients joining it. Without a relay, browsers cannot establish direct connections to one another — the relay acts as a rendezvous point that exchanges the ICE candidates and session descriptions needed to set up a direct P2P connection. Once P2P is established, game traffic flows directly between players and the relay is no longer involved. You can use one of the existing public relays or host your own.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lDEVinux/eaglercraft/llms.txt
Use this file to discover all available pages before exploring further.
Public Relay Servers
The following public relay servers are available for use:wss://relay.deev.is/— lax1dude relay #1wss://relay.lax1dude.net/— lax1dude relay #2wss://relay.shhnowisnottheti.me/— ayunami relay #1
The public relays are provided for convenience and should remain available,
but hosting your own relay gives you control over availability and
performance.
Quick Start
Download sp-relay.jar
Download
sp-relay.jar from the stable download:
stable-download/sp-relay.jarConfig files are generated
On first launch, two files are generated in the working directory:
relayConfig.ini— main relay configuration (port, rate limiting, origin whitelist)relays.txt— list of STUN/TURN servers reported to connecting clients
Edit relayConfig.ini
Open
relayConfig.ini to configure the listen port, rate limiting limits,
and origin whitelist. See Relay Config for a full
reference of every field.Debug Mode
Pass--debug to enable verbose logging that includes the IP address of every
incoming connection:
How the Relay Works
The relay implements a lightweight binary WebSocket protocol to exchange the signaling data required for WebRTC. No game traffic ever passes through the relay — only the handshake packets needed to negotiate a direct P2P connection.Signaling flow
Step 1 — LAN host opens the world- The LAN host opens a WebSocket to the relay.
- Host → Relay: PKT 0x00 — identify as server, send protocol ID.
- Relay → Host: PKT 0x00 — confirm protocol version, assign join code.
- Relay → Host: PKT 0x01 — send ICE server (STUN/TURN) list.
- A client opens a WebSocket to the relay and sends the join code.
- Client → Relay: PKT 0x00 — identify as client, send join code.
- Relay → Client: PKT 0x00 — confirm protocol version, assign client ID.
- Relay → Client: PKT 0x01 — send ICE server list.
- Relay → Host: PKT 0x02 — notify host of the new client and its ID.
- Client → Relay → Host / Host → Relay → Client: PKT 0x03 — ICE candidate exchange.
- Client → Relay → Host / Host → Relay → Client: PKT 0x04 — SDP description (offer/answer) exchange.
- Client → Relay → Host: PKT 0x05 — client signals P2P success.
- Client → Relay → Host: PKT 0x06 — client signals P2P failure.
- Relay → Client: PKT 0xFE — relay signals the client to close its relay WebSocket (P2P is now established).