Caution
- This software is a conceptual mock-up designed to illustrate functionality.
- It is not intended for actual deployment.
- go >= 1.23.5
- iptables or other software that mimic the same behaviour for packets redirection as shown below.
Warning
- Bind IP and game server IP must have different values than the default ones.
- The value for cacheTTL must be between 1 and 30.
- Download the software.
- Add the provided iptables rules.
- Run the compiled binary (A2SQueryCacher).
- Use command line arguments or the JSON file created at first run.
- Download and install Go.
- Clone the repository.
- Go into its own directory.
- Build:
go build -o A2SQueryCacher -ldflags="-s -w" cmd/A2SQueryCacher/main.go
iptables -t nat -A PREROUTING -p udp --dport 27015 --match string --algo kmp --hex-string '|FFFFFFFF54|' -j REDIRECT --to-ports 9110
iptables -t nat -A PREROUTING -p udp --dport 27015 --match string --algo kmp --hex-string '|FFFFFFFF55|' -j REDIRECT --to-ports 9110
iptables -t nat -A PREROUTING -p udp --dport 27015 --match string --algo kmp --hex-string '|FFFFFFFF41|' -j REDIRECT --to-ports 9110
Important
- CLI arguments are checked first.
- If they are not provided the program will continue automatically with the JSON config.
bindip - Local IP address to bind (default: "0.0.0.0")
gameserverip - Game server IP address (default: "127.0.0.1")
bindPort - Local port to bind (default: 9110)
gameserverport - Game server port (default: 27015)
cacheTTL - Cache TTL in seconds (default: 10)
threads - Number of worker threads (default: 4)
Give a ⭐ if this project helped you.