TeamSpeak 6 Server Viewer
Find a file
joshii-h c6acfbc94b fix: prevent bufio panics and goroutine leaks in SSH client
The default bufio.Reader buffer (4096 bytes) is too small for large
ServerQuery responses (channellist, clientlist), causing runtime panics
that leave the viewer in an unrecoverable state.

Changes:
- Increase SSH read buffer from 4096 to 64KB to handle large responses
- Add done channel to SSHClient for clean keepAlive goroutine shutdown
- Stop orphaned keepAlive goroutines after reconnect to prevent leaks
- Add panic recovery in exec() so panics are handled as errors
- Treat recovered panics as connection errors to trigger reconnect
- Wrap HTTP handlers with recovery middleware as a safety net
2026-03-04 10:00:02 +01:00
cmd/server Added fontawesome 2026-02-12 18:16:00 +01:00
http fix: prevent bufio panics and goroutine leaks in SSH client 2026-03-04 10:00:02 +01:00
internal fix: prevent bufio panics and goroutine leaks in SSH client 2026-03-04 10:00:02 +01:00
.gitignore Added complete TS6 Viewer implementation 2026-02-02 01:37:18 +01:00
compose.yml Added fontawesome 2026-02-12 18:16:00 +01:00
dark.png Added fontawesome 2026-02-12 18:16:00 +01:00
Dockerfile Added fontawesome 2026-02-12 18:16:00 +01:00
entrypoint.sh Added fontawesome 2026-02-12 18:16:00 +01:00
go.mod Added fontawesome 2026-02-12 18:16:00 +01:00
go.sum Added fontawesome 2026-02-12 18:16:00 +01:00
LICENSE Added complete TS6 Viewer implementation 2026-02-02 01:37:18 +01:00
light.png Added fontawesome 2026-02-12 18:16:00 +01:00
README.md Added fontawesome 2026-02-12 18:16:00 +01:00

TS6 Viewer

Dark Theme Light Theme

A lightweight, fast, and modern web viewer for TeamSpeak 6 servers.
TS6 Viewer connects to ServerQuery (SSH, Port 10022) and displays live server, channel, and client information.

The viewer is designed to be:

  • Simple to deploy
  • Fast and lightweight
  • Fully clientside autorefreshing
  • Compatible with any TS6 server
  • Customizable via a single config.json file

Features

  • Live TeamSpeak 6 server viewer
  • Autorefresh with configurable interval
  • Dark and light themes
  • Channel tree rendering with clients
  • Spacer and fullwidth channel support
  • Caching + ratelimit protection
  • Pure ServerQuery (SSH) backend
  • Optional voice status (mute status, audio status, talking)

ServerQuery (SSH)

TS6 Viewer communicates exclusively via ServerQuery over SSH.

Advantages:

  • Persistent SSH connection
  • Very fast, even with many clients
  • clientlist -voice provides all audio/mute/talker info in a single call
  • No REST overhead
  • No per-client requests
  • No rate limits

Configuration Files in the Project

The repository includes two important configuration templates:

config.example.json

This file is included in the project and serves as the template for your actual configuration.
You can:

  • rename it manually to config.json, or
  • let Docker generate config.json automatically using environment variables.

Docker Support

The repository includes:

  • Dockerfile.sh — multistage build for Go + Alpine
  • entrypoint.sh — generates config.json dynamically using environment variables
  • docker-compose.yml — ready to run the viewer with one command

This allows you to run TS6 Viewer fully containerized.


Dockerfile.sh explained

The Dockerfile uses two stages:

1) Builder Stage

  • Based on golang:1.20-alpine
  • Copies the entire repository into /app
  • Ensures config.example.json exists
  • Normalizes go.mod to avoid Go version parsing issues
  • Builds a static Linux binary: cmd/server/ts6viewer

2) Runtime Stage

  • Based on alpine:latest
  • Installs CA certificates + gettext (envsubst)
  • Copies the built binary and assets from the builder
  • Copies entrypoint.sh
  • Exposes port 8080
  • Starts the viewer via the entrypoint script

entrypoint.sh explained

The entrypoint script:

  1. Loads environment variables
  2. Applies defaults if variables are missing
  3. Uses envsubst to generate config.json from config.example.json
  4. Starts the TS6 Viewer binary

Environment variables include:

  • SERVER_PORT
  • THEME
  • REFRESH_INTERVAL
  • HOST
  • PORT
  • USER
  • PASSWORD
  • ENABLE_VOICE_STATUS
  • SERVER_ID

This makes the Docker container fully configurable without editing files.

docker-compose.yml

A readytouse compose file is included in the project.
You can start the viewer with:

docker compose up -d

Building the Program

The project is written in Go.

Build on Linux

git clone https://github.com/Maxallica/ts6-viewer.git
cd ts6viewer
go build -o ts6viewer

Build Windows binary on Linux

cd "*/ts6-viewer/cmd/server"
GOOS=windows GOARCH=amd64 go build -o ts6viewer.exe

Running on Linux

./ts6viewer

Build on Windows

git clone https://github.com/Maxallica/ts6-viewer.git
cd ts6viewer
go build -o ts6viewer.exe

Build Linux binary on Windows

cd "*/ts6-viewer/cmd/server"
$env:GOOS="linux"
$env:GOARCH="amd64"
go build -o ts6viewer

Running on Windows

.\ts6viewer.exe

Navigate to the TS6 Viewer page

http(s)//<ip>:<port>/ts6viewer


❤️ Made with love in Germany