Skip to content

Reverse proxy

The relay speaks plain HTTP. A reverse proxy in front of it must:

  1. terminate TLS for your domain,
  2. forward to the relay’s port (127.0.0.1:8080 with the defaults),
  3. pass the WebSocket upgrade through for /ws, and not time out an idle WebSocket quickly,
  4. set X-Forwarded-For — the admin login rate limiter uses it to tell clients apart.

Caddy gets a certificate, handles WebSockets and sets X-Forwarded-For on its own:

Caddyfile
tpp.example.com {
reverse_proxy 127.0.0.1:8080
}
Terminal window
curl -fsS https://tpp.example.com/healthz # → ok

Then sign in at https://tpp.example.com/admin/.

Path Purpose
/healthz Health check. Returns ok.
/ws The devices’ WebSocket.
/admin/ The admin page: dashboard and creation tokens. Its own API is under /admin/api/.
/pair The page a pairing link opens on a device without the app.
/source Redirects to the relay’s source code (TPP_SOURCE_URL).
/<token> Group creation. A browser GET returns 404 on purpose; only the app’s POST uses the token.