lhridder / gamma

Minecraft bedrock Proxy
9 stars 1 forks source link

Gamma - a Minecraft bedrock Proxy

adaptation from haveachin/bedprox

Added/changed Features

TODO

Command-Line Flags

-config-path specifies the path to all your server configs [default: "./configs/"]

Example Usage

./gamma -config-path="."

Global config.yml

Example/Default

debug: false
genericJoinResponse: There is no proxy associated with this domain. Please check your configuration.
receiveProxyProtocol: false
prometheus:
  enabled: false
  bind: :9060
api:
  enabled: false
  bind: :5000
ping:
  edition: MCPE
  versionname: 1.19.50
  versionProtocol: 560
  description: Gamma proxy
  playerCount: 0
  maxPlayerCount: 10
  gamemode: SURVIVAL
  gamemodeNumeric: 1

Values can be left out if they don't deviate from the default, a config.json with just {} is still required for startup.

Fields

Proxy Config

Examples

Minimal Config

min.example.com ```json { "domainNames": ["mc.example.com", "example.com"], "proxyTo": ":8080" } ```

Full Config

full.example.com ```json { "domains": ["mc.example.com", "example.com"], "listenTo": ":19132", "proxyTo": ":8080", "proxyProtocol": false, "dialTimeout": 1000, "dialTimeoutMessage": "Server is currently offline", "sendProxyProtocol": false } ```

Prometheus exporter

The built-in prometheus exporter can be used to view metrics about gamma' operation. This can be used through "prometheusEnabled": true and "prometheusBind": ":9070" in config.yml It is recommended to firewall the prometheus exporter with an application like ufw or iptables to make it only accessible by your own Prometheus instance.

Prometheus configuration:

Example prometheus.yml configuration:

scrape_configs:
  - job_name: gamma
    static_configs:
    - targets: ['gamma-exporter-hostname:port']

Metrics:

API

Route examples

GET /proxies will return

[
"config",
"config2"
]

GET /proxies/{name} will return

{
"domainNames": ["play.example.org"],
"proxyTo": "backend.example.org:25566"
}

POST /proxies/{name} with body

{
"domainNames": ["play.example.org"],
"proxyTo": "backend.example.org:25566"
}

will return

{"success": true, "message": "the proxy has been succesfully added"}

DELETE /proxies/{name} will return 200(OK)

GET / will return 200(OK)

Used sources