kaibloecker / go-mumble-ping

Microservice that translates the Mumble Ping to JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-mumble-ping

Microservice that translates the Mumble Ping to JSON.

Build GitHub go.mod Go version Go Reference Go Report Card License GitHub issues GitHub last commit

Why?

The murmur server offers a way to see how many users are active without connecting/logging in. Since Mumble is used mostly by communities, it would be great if they could show a user counter on their website. Unfortunately this functionality is only exposed through a custom formatted UDP datagram and therefore not usable by ordinary javascript.

go-mumble-ping aims to bridge that gap by exposing a webserver that returns JSON on its / route (see usage). The mumble server is queried when the webserver is queried. Successful responses are cached for 15 seconds.

Requirements

Have a local go install.

Usage

Build an run:

$ go run .

In another shell, query the server:

$ curl -s http://localhost:8080/
{
    "server_version": "1.3.4",
    "last_update": 1674767226,
    "connected_users": 5,
    "max_users": 100,
    "bandwidth": 72000
}

In case of an error, the server returns an HTTP 5xx status code and a JSON object with a message key containing the error message.

You can run go-mumble-ping on its own, but it's probably best to integrate it into an existing nginx as an upstream server and binding it to a path like /mumble_status.json.

Configuration

All configuration is done via environment variables.

Environment Variables

Variable Description
MUMBLE_HOST The hostname of your mumble server, defaults to localhost.
MUMBLE_PORT The port of your mumble server, defaults to 64738.
PORT The port go-mumble-ping will listen on, defaults to 8080.

Project Status

The basic functionality is stable. No further development to be expected.

Contributing

PRs are open.

License

This project is released under the MIT License.

Copyright © 2023 Kai Blöcker

About

Microservice that translates the Mumble Ping to JSON

License:MIT License


Languages

Language:Go 100.0%