From 43183717f6b5fcd8d90a0b3454353f9d81da9fd8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 6 May 2025 23:38:31 +0100 Subject: [PATCH] upd readme --- README.md | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ed43de8..f65ff7b 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,36 @@ Unfortunately the Q3Rcon engine ties the rcon port to the game servers public po ### Use -Run one or multiple rcon proxies by setting an environment variable `Q3RCON_TARGET_PORTS` - -for example: +#### Flags ```bash +#!/usr/bin/env bash + +/usr/local/bin/q3rcon-proxy \ + --proxy-host=0.0.0.0 \ + --target-host=localhost \ + --ports-mapping=28961:28960 \ + --session-timeout=20 \ + --loglevel=debug +``` + +#### Environment Variables + +Each of the flags has a corresponding environment variable: + +- `Q3RCON_PROXY_HOST`: The host the proxy server sits on. +- `Q3RCON_TARGET_HOST`: The host the game servers sit on. +- `Q3RCON_PORTS_MAPPING`: A mapping as a with `source:target` pairs delimited by `;`. +- `Q3RCON_SESSION_TIMEOUT`: Timeout in seconds for each udp session. +- `Q3RCON_LOGLEVEL`: The application's logging level (see [Logging][logging]). + +Multiple rcon proxies may be configured by setting *--ports-mapping/Q3RCON_PORTS_MAPPING* like so: + +```console export Q3RCON_TARGET_PORTS="20000:28960;20001:28961;20002:28962" ``` -This would configure q3rcon-proxy to run 3 proxy servers listening on ports `20000`, `20001` and `20002` that redirect rcon requests to game servers on ports `28960`, `28961` and `28962` respectively. - -Then just run the binary which you can compile yourself, download from `Releases` or use the included Dockerfile. +This would configure q3rcon-proxy to run 3 proxy servers listening on ports 20000, 20001 and 20002 that redirect rcon requests to game servers on ports 28960, 28961 and 28962 respectively. ### Logging @@ -47,4 +66,5 @@ If not set it will default to `info`. For a compatible rcon client also written in Go consider checking out the [Q3 Rcon][q3rcon] package. -[q3rcon]: https://github.com/onyx-and-iris/q3rcon \ No newline at end of file +[q3rcon]: https://github.com/onyx-and-iris/q3rcon +[logging]: https://github.com/onyx-and-iris/gignore?tab=readme-ov-file#logging \ No newline at end of file