v1.8.1

sleep3r/mtproto.zigv1.8.1Jun 13, 2026by sleep3r

Upgrading?

AI Summary

Fixes a Safari-specific issue where the dashboard live-logs WebSocket failed due to missing HTTP Basic credentials.

Key Highlights

  • Fixed dashboard live-logs in Safari by adding an alternative token-based authentication for WebSockets.

New Features

  • Safari WebSocket auth fix

Full Release Notes

<details open>
<summary>🇷🇺 Что нового (RU)</summary>

## Фикс: лайв-логи дашборда в Safari

Лайв-логи мониторинг-дашборда (`proxy-monitor`) падали **только в Safari** — `WebSocket … failed: bad response from the server`; в Chrome/Firefox всё работало.

**Причина:** Safari/WebKit **не переотправляет кешированную HTTP Basic-учётку на ws://-рукопожатии** (Chrome/Firefox — переотправляют). Дашборд гейтит `/ws/logs` по Basic, поэтому у Safari запрос приходил без `Authorization` → сервер закрывал соединение (1008) → «bad response».

**Что сделано:** WebSocket теперь принимает **Basic ИЛИ короткоживущий подписанный тикет**. Уже залогиненная страница берёт тикет с нового `GET /api/ws-ticket` (обычный запрос — Basic переотправляется во всех браузерах, включая Safari) и открывает `/ws/logs?ticket=…`. Тикет — stateless HMAC над своим сроком под токеном дашборда (~30с TTL). Host-pin и Origin-проверки не тронуты — защита от DNS-rebinding/CSRF на месте. Плюс бамп cache-bust версии `app.js`, чтобы браузеры подтянули свежий клиент без хард-рефреша.

CLI-only изменение (дашборд внутри `mtbuddy`); сам прокси-сервис не меняется.

</details>

---

<details>
<summary>🇬🇧 Release notes (EN)</summary>

## Fix: dashboard live-logs in Safari

The monitoring dashboard's (`proxy-monitor`) live-logs WebSocket failed **only in Safari** — `WebSocket … failed: bad response from the server`; Chrome/Firefox were fine.

**Cause:** Safari/WebKit **does not replay cached HTTP Basic credentials on a WebSocket handshake** (Chrome/Firefox do). The dashboard gates `/ws/logs` behind Basic auth, so Safari's handshake arrived without `Authorization` → the server closed it (1008) → "bad response".

**Fix:** the WebSocket now accepts **Basic auth OR a short-lived signed ticket**. The already-authenticated page fetches a ticket from a new `GET /api/ws-ticket` (a normal request, which replays Basic auth in every browser including Safari) and opens `/ws/logs?ticket=…`. The ticket is a stateless HMAC over its own expiry under the dashboard token (~30s TTL). The Host-pin and Origin gates are untouched, so the DNS-rebinding / CSRF defenses still hold. Also bumps the `app.js` cache-bust version so browsers pick up the new client without a hard refresh.

CLI-only change (the dashboard ships inside `mtbuddy`); the proxy service itself is unchanged.

</details>

---

**Full Changelog**: https://github.com/sleep3r/mtproto.zig/compare/v1.8.0...v1.8.1

Related Repositories