Connecting Backends
Every backend opens a connection to the proxy. In most networks this needs no setup: both sides use the Velocity forwarding secret, a backend learns the proxy's address when its first player arrives, and the proxy finds each backend's name in velocity.toml by itself. This page covers the cases that need a setting.
Hub Port and Firewall
The proxy listens for backends on the hub port, set by bind in config.json. The default 0.0.0.0:25580 means port 25580 on every network interface. Backends connect to the proxy and never the other way round, so backends need no open port for MythicProxy.
Open the hub port to your backends only.
Anyone who can reach the hub port can try to connect. A connection without the secret is refused, but the traffic is not encrypted, see Connections and Security.
To listen on one address only, set bind to it, for example "bind": "10.0.0.5:25580". The proxy then also announces that address, unless you set advertise.
Secret
The proxy and every backend need the same secret.
With Velocity modern forwarding there is nothing to set: both sides use the forwarding secret that Velocity already shares with the backends.
With legacy (BungeeCord) forwarding or no forwarding, the backends have no forwarding secret, so set the same secret on both sides. Any text works.
In plugins/mythicproxy/config.json on the proxy (only the changed key is shown):
{
"secret": "replace-with-a-long-random-text"
}
In plugins/MythicProxy/config.yml on every backend:
secret: "replace-with-a-long-random-text"
Where the Secret Comes From
Each side uses the first of these that gives a secret.
On the proxy:
secretinconfig.json- The Velocity forwarding secret: the file named by
forwarding-secret-fileinvelocity.toml(forwarding.secretby default)
On a backend:
secretinconfig.yml- The environment variable
PAPER_VELOCITY_SECRET proxies.velocity.secretinconfig/paper-global.yml, but only whenproxies.velocity.enabledistruethere
velocity.toml, the secret file and config/paper-global.yml are read from the folder the server was started from. Set secret yourself when a server is started from another folder, or when you want a different secret than the forwarding one.
A side that finds no secret stays disabled, and a backend with a different secret is refused. See Troubleshooting for the console messages.
How Backends Find the Proxy
When a player connects to a backend through the proxy, the proxy sends that backend the address of its hub. The backend adds the address to proxies in its config.yml, saves the file and connects. On later starts it connects by itself.
So a brand-new backend connects only after its first player has arrived, and it misses that player's join, see Missed Events. To have it connect at the first start, list the proxy yourself.
Listing a Proxy
Write each proxy as host:port under proxies in plugins/MythicProxy/config.yml. Without a port, 25580 is used.
proxies:
- "10.0.0.5:25580"
- Use the address the proxy announces: its
advertisevalue, or the address afterannouncing hubin the proxy's enable line. If your entry has another IP address or port, the next announcement adds a second entry for the same proxy, and the two connections keep replacing each other. - A host name is looked up once, when the backend starts. If that fails, or the address behind the name changes later, restart the backend.
- A port that is not a number stops MythicProxy from starting on that backend.
- Edit
config.ymlwhile the backend is stopped, see Paper Config.
Announced Address
The proxy announces advertise from config.json, exactly as written. While advertise is empty, it announces the bind address if that is a single address, otherwise the first IPv4 address of an active network adapter that is not loopback, and 127.0.0.1 if there is none. The proxy's enable line shows the address after announcing hub.
Set advertise to a host:port that your backends can reach when the automatic address is wrong: with several network adapters (virtual and VPN adapters count too), behind NAT or port forwarding, or in Docker.
{
"advertise": "10.0.0.5:25580"
}
Removing a Wrong Address
A backend never removes a saved address, and one it cannot reach logs a warning every 5 seconds. To fix it:
- Set
advertiseon the proxy and restart the proxy. - Stop the backend, remove or correct the entry in
proxies, and start the backend again.
If you removed the entry, connect a player to the backend so that the proxy announces the correct address.
Server Names
Every backend has a name on the network, which must be its name under [servers] in velocity.toml. Join, switch and quit events and signals sent to server:NAME use this name.
While server-name is empty, which is the default, the proxy finds the name itself: it looks for the server in velocity.toml whose host is the address the backend connects from and whose port is the backend's own server port. Exactly one server must match.
Set server-name in plugins/MythicProxy/config.yml when that cannot work:
- behind NAT, with port forwarding, or in a Docker bridge network
- when the port in
velocity.tomldiffers from the backend's server port - on one machine, when
velocity.tomllists the servers as127.0.0.1orlocalhost(settingadvertiseto127.0.0.1:25580on the proxy also works)
server-name: "survival"
- Write the name exactly as
velocity.tomllists it. A name thatvelocity.tomldoes not list is accepted with a warning, but that backend gets no join, switch or quit events. - Give every backend its own name. Two backends with the same name keep replacing each other's connection.
- Do not use the proxy's
proxy-id(defaultproxy) as a server name. That backend would ignore the messages the proxy itself sends, such as join, switch and quit events and stored variables.
With more than one proxy, see Multiple Proxies.