Skip to content

Commit

Permalink
Merge pull request #38 from startersclan/docs/readme-fix-url-to-daemo…
Browse files Browse the repository at this point in the history
…n-s-proxy-key-code

Docs (readme): Fix URL to daemon's `proxy_key` code
  • Loading branch information
leojonathanoh committed Mar 26, 2023
2 parents ac21767 + 3052dd2 commit 9935236
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A simple UDP forwarder to the HLStatsX:CE daemon.

The [HLStatsX:CE perl daemon](https://github.com/startersclan/hlstatsx-community-edition/tree/master/scripts) infers a gameserver's IP:PORT from the client socket from which it receives (reads) the gameserver's `logaddress_add` logs. This means both the daemon and the gameservers have to run on the same network.

This UDP forwarder eliminates this need by leveraging on an already built-in proxy protocol in the daemon - It simply runs as a sidecar to the gameserver, receives logs from the gameserver, prepends each log line with a spoofed `IP:PORT` as well as a secret [`PROXY_KEY`](https://github.com/startersclan/hlstatsx-community-edition/blob/v1.6.19/scripts/hlstats.pl#L1780) only known by the daemon, and finally sends that log line to the daemon. The daemon reads the gameserver's `IP:PORT` from each log line, rather than the usual inferring it from the client socket.
This UDP forwarder eliminates this need by leveraging on an already built-in proxy protocol in the daemon - It simply runs as a sidecar to the gameserver, receives logs from the gameserver, prepends each log line with a spoofed `IP:PORT` as well as a [`proxy_key`](https://github.com/startersclan/hlstatsx-community-edition/blob/1.6.19/scripts/hlstats.pl#L1780) secret only known by the daemon, and finally sends that log line to the daemon. The daemon reads the gameserver's `IP:PORT` from each log line, rather than the usual inferring it from the client socket.

`source-udp-forwarder` uses less than `3MB` of memory.

Expand Down Expand Up @@ -76,7 +76,7 @@ Run `source-udp-forwarder -help` to see command line usage:
|---|---|
| `UDP_LISTEN_ADDR` | `<IP>:<PORT>` to listen on for incoming packets. Default value: `:26999` |
| `UDP_FORWARD_ADDR` | `<IP>:<PORT>` or `<HOSTNAME>:<PORT>` to which incoming packets will be forwarded. Default value: `127.0.0.1:27500` |
| `FORWARD_PROXY_KEY` | The [`PROXY_KEY`](https://github.com/startersclan/hlstatsx-community-edition/blob/v1.6.19/scripts/hlstats.pl#L1780) secret defined in the HLStatsX:CE Web Admin Panel. Default value: `XXXXX` |
| `FORWARD_PROXY_KEY` | The [`proxy_key`](https://github.com/startersclan/hlstatsx-community-edition/blob/1.6.19/scripts/hlstats.pl#L1780) secret defined in the HLStatsX:CE Web Admin Panel. Default value: `XXXXX` |
| `FORWARD_GAMESERVER_IP` | IP that the sent packet should include. Default value: `127.0.0.1` |
| `FORWARD_GAMESERVER_PORT` | Port that the sent packet should include. Default value: `27015` |
| `LOG_LEVEL` | Log level. Defaults to `INFO`. May be one of the following (starting with the most verbose): `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`. Default value: `INFO`|
Expand Down
6 changes: 3 additions & 3 deletions docs/hlds-cstrike-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ services:
# 2. The proxy forwards gameserver logs to the daemon
# source-udp-forwarder: https://github.com/startersclan/source-udp-forwarder
source-udp-forwarder:
image: startersclan/source-udp-forwarder:master
image: startersclan/source-udp-forwarder:latest
environment:
- UDP_LISTEN_ADDR=:26999
- UDP_FORWARD_ADDR=127.0.0.1:27500
- FORWARD_PROXY_KEY=somedaemonsecret # The daemon's proxy secret
- FORWARD_PROXY_KEY=somedaemonsecret # The daemon's proxy_key secret
- FORWARD_GAMESERVER_IP=192.168.1.100 # The gameserver's IP as registered in the HLStatsX:CE database
- FORWARD_GAMESERVER_PORT=27015 # The gameserver's IP as registered in the HLStatsX:CE database
- LOG_LEVEL=DEBUG
- LOG_FORMAT=txt
network_mode: host

# 3. HLStatsX:CE perl daemon accepts the gameserver logs. Gameserver Logs are parsed and stats are recorded
# The FORWARD_PROXY_KEY secret can only be setup in the HLStatsX:CE Web Admin Panel
# The daemon's proxy_key secret can only be setup in the HLStatsX:CE Web Admin Panel and not via env vars
# HLStatsX:CE perl daemon: https://github.com/startersclan/docker-hlstatsxce-daemon
# NOTE: Currently, as of v1.6.19, the daemon crashes upon startup. You will need to fix perl errors and rebuild the image.
daemon:
Expand Down
6 changes: 3 additions & 3 deletions docs/srcds-hl2mp-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ services:
# 2. The proxy forwards gameserver logs to the daemon
# source-udp-forwarder: https://github.com/startersclan/source-udp-forwarder
source-udp-forwarder:
image: startersclan/source-udp-forwarder:master
image: startersclan/source-udp-forwarder:latest
environment:
- UDP_LISTEN_ADDR=:26999
- UDP_FORWARD_ADDR=127.0.0.1:27500
- FORWARD_PROXY_KEY=somedaemonsecret # The daemon's proxy secret
- FORWARD_PROXY_KEY=somedaemonsecret # The daemon's proxy_key secret
- FORWARD_GAMESERVER_IP=192.168.1.100 # The gameserver's IP as registered in the HLStatsX:CE database
- FORWARD_GAMESERVER_PORT=27015 # The gameserver's IP as registered in the HLStatsX:CE database
- LOG_LEVEL=DEBUG
- LOG_FORMAT=txt
network_mode: host

# 3. HLStatsX:CE perl daemon accepts the gameserver logs. Gameserver Logs are parsed and stats are recorded
# The FORWARD_PROXY_KEY secret can only be setup in the HLStatsX:CE Web Admin Panel
# The daemon's proxy_key secret can only be setup in the HLStatsX:CE Web Admin Panel and not via env vars
# HLStatsX:CE perl daemon: https://github.com/startersclan/docker-hlstatsxce-daemon
# NOTE: Currently, as of v1.6.19, the daemon crashes upon startup. You will need to fix perl errors and rebuild the image.
daemon:
Expand Down

0 comments on commit 9935236

Please sign in to comment.