Velocity proxy setup
RecommendedInstall and configure the Velocity connector, which owns hostname attribution and session tracking.
Velocity is where a player connection first arrives, so the connector reads the virtual host there and owns join and quit tracking for the whole network.
#Requirements
- A Velocity proxy and a Java 21 runtime.
- Outbound HTTPS to the MCAnalytics ingest host on port 443.
- A writable plugin folder, so the paired credential can be stored.
#Configuration reference
The config file is plugins/mcanalytics/config.toml. These are the keys the connector reads, with the values it ships with.
tomlplugins/mcanalytics/config.toml
# Pair from the console instead of pasting a token:
# /mca pair <code>
api_token = "mca_live_CHANGE_ME_TO_YOUR_TOKEN"
# Ingestion API base URL.
endpoint_url = "https://analytics.mcanalytics.net"
# Name for this proxy. After pairing, the dashboard name wins.
server_name = "velocity-proxy"
# Where the paired credential is stored, relative to this folder.
# credential_file = "credential.json"
heartbeat_interval_seconds = 10
connect_timeout_seconds = 5
request_timeout_seconds = 10
max_retries = 10
drain_timeout_seconds = 5
spool_file = "spool.db"
spool_size_limit_mb = 50
spool_queue_capacity = 5000
batch_size = 50#Environment overrides
Set these when the proxy runs from a read only image, or when you keep secrets outside the container. An environment token wins over the file and the paired credential, and is never written to.
| Variable | Overrides |
|---|---|
| MCANALYTICS_API_TOKEN | api_token, and any paired credential |
| MCANALYTICS_ENDPOINT_URL | endpoint_url |
| MCANALYTICS_SERVER_NAME | server_name |
| MCANALYTICS_CREDENTIAL_FILE | credential_file |
#Console commands
Console by default
On a bare proxy with no permission plugin, mcanalytics.admin is granted to the console and to nobody else.
| Command | Permission | What it does |
|---|---|---|
| /mca status | mcanalytics.admin | Credential state, endpoint, transport and spool health |
| /mca pair <code> | mcanalytics.admin | Redeems a pairing code and stores the credential |
| /mca inspect <hostname> | mcanalytics.admin | Shows how the proxy resolves one hostname |
| /mca help | mcanalytics.admin | Lists the commands |