udpproxy

package module
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Q3 Rcon Proxy

A modification of lilproxy that forwards only Q3 rcon/query packets. Useful for separating the rcon port from the game server port.

Why

Unfortunately the Q3Rcon engine ties the rcon port to the game servers public port used for client connections. This proxy will allow you to run rcon through a separate whitelisted port.

Use
Flags
#!/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 string 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).

Multiple rcon proxies may be configured by setting --ports-mapping/Q3RCON_PORTS_MAPPING like so:

export Q3RCON_PORTS_MAPPING="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.

Logging

Set the log level with environment variable Q3RCON_LOGLEVEL.

Acceptable values are:

  • trace
  • debug
  • info
  • warn
  • error
  • fatal
  • panic

If not set it will default to info.

Special Thanks

Dylan For writing lilproxy.

Further Notes

For a compatible rcon client also written in Go consider checking out the Q3 Rcon package.

Documentation

Overview

Package udpproxy implements a simple UDP proxy server that forwards rcon and query packets between clients and a target server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a UDP proxy server that forwards rcon and query packets between clients and a target server. It maintains a session cache to manage client sessions and handles packet forwarding between clients and the target server.

func New

func New(proxy, target string, options ...Option) (*Client, error)

New creates a new Client with the specified proxy and target addresses, and applies any provided options.

func (*Client) ListenAndServe

func (c *Client) ListenAndServe() error

ListenAndServe starts the UDP proxy server and listens for incoming packets from clients. It reads packets from the proxy connection, checks for existing sessions, and forwards packets to the target server.

type Option

type Option func(*Client)

Option is a functional option type that allows us to configure the Client.

func WithSessionTimeout

func WithSessionTimeout(timeout time.Duration) Option

WithSessionTimeout is a functional option to set the session timeout.

Directories

Path Synopsis
cmd
q3rcon-proxy command
Package main implements a command-line application for a Quake 3 RCON proxy server.
Package main implements a command-line application for a Quake 3 RCON proxy server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL