The sp-relay generatesDocumentation 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.
relayConfig.ini (and relays.txt) in the working directory on first launch. Edit relayConfig.ini to change the listen port, configure rate limiting, and restrict which client origins can use the relay. Edit relays.txt to configure the STUN/TURN servers sent to connecting clients.
The relay must be restarted for any configuration changes to take effect.
Type
stop in the relay console and re-run java -jar sp-relay.jar.relayConfig.ini Fields
The config file useskey: value syntax. All keys are case-insensitive.
Network
The IP address the WebSocket server binds to. Use
0.0.0.0 to listen on all
interfaces, or specify a single IP to restrict the bind to one network
interface.The port the relay WebSocket server listens on. Clients connect to your relay
via
wss://your-host:<port>/. Make sure this port is open in your firewall
for external connections.Join Code Generation
The length (in characters) of the randomly generated join codes assigned to
LAN worlds. Longer codes reduce the chance of collisions on a busy relay.
The character set used when generating join codes. Must contain at least 2
characters.
When
true, generated join codes randomly mix upper and lower case characters
from code-chars. Increases the effective code space without increasing code
length.Connection Limits
Maximum number of simultaneous WebSocket connections allowed from a single IP
address. Connections exceeding this limit are immediately closed.
Maximum number of simultaneously open LAN worlds allowed from a single IP
address.
World (Open) Rate Limiting
These settings control how often a single IP can open new LAN worlds.Enable or disable rate limiting for world-open requests.
The sliding window period in seconds over which world-open requests are
counted.
Maximum number of world-open requests permitted from one IP within
world-ratelimit-period seconds before the request is blocked.If requests from an IP reach this count within the period, the IP is locked
out for
world-ratelimit-lockout-duration seconds.Lockout duration in seconds applied when an IP exceeds
world-ratelimit-lockout-limit.Ping Rate Limiting
These settings control how often a single IP can ping (query) the relay.Enable or disable rate limiting for relay ping/query requests.
The sliding window period in seconds over which ping requests are counted.
Maximum number of ping requests permitted from one IP within
ping-ratelimit-period seconds.Lockout trigger threshold for ping requests within the period.
Lockout duration in seconds for IPs that exceed the ping lockout limit.
Origin Whitelist
A semicolon (
;) separated list of domains used to restrict which sites are
allowed to use your relay. When left blank, all origins are permitted.Special values:offline— allow offline download clients (connections withOrigin: null)null— allow connections that do not specify anOrigin:header at all*wildcard prefix — e.g.*.deev.isallows all subdomains ofdeev.is
Theorigin-whitelistconfig variable is a semicolon (;) separated list of domains used to restrict what sites are to be allowed to use your relay. When left blank it allows all sites. Addofflineto allow offline download clients to use your relay as well, andnullto allow connections that do not specify anOrigin:header. Use*as a wildcard, for example:*.deev.isallows all domains ending with “deev.is” to use the relay.
Reverse Proxy Support
When
true, the relay reads the client’s real IP from an HTTP header
forwarded by a reverse proxy (e.g. NGINX) instead of the raw socket address.
Required for accurate rate limiting and connection limits when running behind
a proxy.The name of the HTTP header that carries the real client IP when
enable-real-ip-header is true. Matches the header set by proxy_set_header X-Real-IP $remote_addr in NGINX.Miscellaneous
When
true, the relay responds to local-world poll requests (PKT 0x04
connection type) with a list of LAN worlds open from the same IP address.
This is what populates the Multiplayer screen with nearby LAN worlds.A human-readable label returned in relay ping responses. Visible to clients
that query the relay’s metadata.
Example Config
relayConfig.ini
relays.txt
relays.txt configures the STUN and TURN servers the relay reports to every
connecting client via PKT 0x01. Clients use these servers to discover their
public IP/port and to relay media when a direct P2P path is unavailable (strict
NAT or symmetric NAT environments).
The file uses INI-style sections. Each STUN entry requires a url field; each
TURN entry requires url, username, and password.
relays.txt
relays.txt is populated with public Google STUN servers. Add your
own TURN server entries for networks with strict or symmetric NAT where direct
P2P connections cannot be established without a relay media path.
Firewall
The relay’s WebSocket port (default6699) must be open in your firewall for
external clients to reach it.
On Linux with ufw:
firewalld:
Adding the Relay to Clients
Players must add your relay URL to their client before they can join or host worlds on it. They do this from the Multiplayer screen → Network Settings → Add Relay, then enter the fullwss:// URL.
Pre-configuring the relay in eaglercraftOpts
If you are hosting your own Eaglercraft client, you can pre-populate the relay list by editing thewindow.eaglercraftOpts variable in your index.html:
primary: true makes this relay the default relay used when opening a
world to LAN.