Multi-proxy

Share global chat, private messages, the online player list, and the chat toggle across several proxies with Redis.

If your network runs more than one proxy, for example behind a load balancer, players on different proxies cannot see each other's global chat. The multi-proxy bridge links the proxies through Redis. It is off by default. With a single proxy, you can skip this page.

Requirements

  • A Redis server (6.x or newer) that every proxy can reach. A standalone server is enough. Passwords and TLS are supported.
  • Every proxy points at the same Redis server, the same database, and the same channels.prefix.
  • Every proxy runs the same NexusShout version.

Set up

  1. On every proxy, in config.yml:
multi-proxy:
  enabled: true
  redis:
    host: "10.0.0.5"
    port: 6379
    password: "your-redis-password"
  1. Restart each proxy, or run nshoutreload.
  2. Test it: send /gchat hello as a player on one proxy. A player on another proxy should see it.

The console shows Multi-proxy bridge enabled (proxy-id=...) and connected to Redis when it works.

Settings

All settings are under multi-proxy in config.yml.

SettingDefaultNotes
enabledfalse
proxy-id""This proxy's name. Empty: a random ID is created and saved in proxy-id.txt in the plugin folder. Set your own for readable logs, such as proxy-eu-1
redis.hostlocalhost
redis.port6379
redis.password""Empty when Redis has no password
redis.database0
redis.timeout-ms3000
redis.use-sslfalsetrue for a TLS connection
redis.pool-max-total8Most connections used for sending
redis.pool-max-idle4Most idle connections kept open
channels.prefixnexusshoutPut in front of every Redis key and channel. Use a different prefix for each separate network on one Redis server
heartbeat-interval10Seconds, from 1 to 60. A crashed proxy's players drop off the shared player list after three times this

Every proxy needs its own proxy-id. A proxy ignores messages that carry its own ID, so two proxies with the same ID cannot see each other. If you copy the plugin folder to a new proxy, delete proxy-id.txt in the copy first.

Features

multi-proxy:
  features:
    chat: true
    private-messages: true
    online-roster: true
    toggle-state: true
    cooldown: false
FeatureDefaultWhat it shares
chatOnGlobal chat, and Discord messages brought in by the bot
private-messagesOn/nmsg and /nr to players on other proxies. Needs online-roster
online-rosterOnThe list of players on other proxies, used to find private message targets and for tab completion
toggle-stateOnGlobal chat mode follows the player to any proxy and is kept when they reconnect
cooldownOffCooldowns count across proxies, so players cannot skip one by switching proxy. Adds one Redis call per message

Discord on several proxies

You can use the same discord.yml on every proxy:

  • Minecraft to Discord: only the proxy where the message was sent posts it.
  • Discord to Minecraft: when several proxies run the bot, one of them takes each Discord message and shares it with the others.

Joins and leaves are posted by the proxy the player is on. The bot status counts players on its own proxy only.

Good to know

  • Use the same format on every proxy. The proxy where a message is sent builds it with its own format and placeholders, and the other proxies show it as it is.
  • Each proxy still applies its own enabled-servers when showing messages.
  • Players who are vanished (PremiumVanish or SayanVanish) when they join or switch servers are left out of the shared player list. Players on other proxies cannot reach them with /nmsg or /nr, even with nshout.vanish.see. Someone who vanishes mid-session stays on the list until they switch servers.
  • Keep Redis on a private network with a password. Anyone who can reach it can post chat and private messages as any player.
  • nshoutreload disconnects from Redis and connects again.

When Redis is down

  • At startup: a warning is logged, local chat keeps working, and NexusShout keeps trying to connect in the background.
  • Later on: messages to other proxies are lost while it is down. NexusShout reconnects on its own, waiting 1 to 30 seconds between tries. The shared player list expires.
  • Discord messages that arrive while Redis is down are shown once on each proxy, without duplicates.
  • If a proxy crashes, its players drop off the shared player list after three times heartbeat-interval seconds.