The gateway only publishes `connected` once the directory snapshot lands in
`sendInitialState()`. Between authenticating and that point the session is in
`syncing` while `hasConnectedOnce` is still false. `onDisconnect` required both
`hasConnectedOnce` and `state === "connected"`, so a transport drop inside that
gap returned early and did nothing:
* no `disconnected` frame for the browser,
* no `scheduleReconnect`,
* no peer/WeRTC rollback, no teardown.
The session stayed in `syncing` with the browser socket still open, the client
kept showing the connecting state forever, and nothing could recover it short
of the user closing the tab. `onKick` had the same gap via its own
`if (!hasConnectedOnce) return;` guard, so a kick or ban during the same window
was silently ignored while the gateway kept the dead session alive.
The window is not momentary. `tsClient.connect()` resolves even when the
directory reconciliation fails (the failure is logged and the explicit snapshot
emit is skipped), and `resetDirectoryForReconnect()` clears the snapshot on
every recovery, so each reconnect attempt opens the window again.
Treat the settling states (`authenticating`, `syncing`) as an explicit concept
and handle transport loss there:
* a drop during the first connect is a connect failure, not an interruption:
report `connectionFailed`, close with 4003 and tear the session down;
* the same reporting is now shared by the rejected-`connect()` path through a
single `failConnect` helper, so a transport that reports itself twice (a
`disconnected` event plus a rejected connect) still fails exactly once;
* a drop during a *reconnect* handshake returns the session to `reconnecting`
and schedules another attempt instead of stalling in `syncing`;
* a kick that lands before the session settles is reported and terminal.
A drop on an established session keeps the previous behaviour: `disconnected`
plus a scheduled reconnect.
Covered by three regression tests over the real WebSocket wiring with only the
external SDK stubbed: a drop before the directory sync, a kick in the same
window, and a drop during a reconnect handshake. All three hang on the old code.
WebSpeak
让 TeamSpeak 自然地进入浏览器。
A self-hosted browser voice client for TeamSpeak 3 and TeamSpeak 6.
简体中文文档 · English documentation · Deutsche Dokumentation · Русская документация · 日本語ドキュメント
项目简介 · Overview
| 逻辑 | 中文 | English |
|---|---|---|
| WHAT | WebSpeak 是一个可自行部署的 TeamSpeak 3 / TeamSpeak 6 网页客户端与语音网关。 | WebSpeak is a self-hosted browser client and voice gateway for TeamSpeak 3 and TeamSpeak 6. |
| WHY | 无需安装桌面客户端,用户打开网页即可加入频道;部署者仍然掌控目标服务器、访问策略和数据。 | Users can join a voice channel from a browser without installing a desktop client, while the operator keeps control of servers, access, and data. |
| HOW | 部署后在管理员控制台配置 TeamSpeak 目标和访问方式,浏览器负责交互与音频,WebSpeak 负责网关连接。 | Configure the TeamSpeak target and access policy in the administration console. The browser handles interaction and audio; WebSpeak provides the gateway connection. |
文档 · Documentation
- 简体中文
- English
- Deutsch
- Русский
- 日本語
- 皮肤开发指南 / Skin development guide
- 皮肤开发 Agent Skill / Skin Development Agent Skill
社区 · Community
友链项目 · Friend projects
NeteaseTSBot
面向 TeamSpeak 3/6 的多平台音乐点播机器人,支持网易云音乐、QQ 音乐和 Bilibili 音频播放,并提供 Web 控制台。
A multi-platform music bot for TeamSpeak 3/6 with Netease Cloud Music, QQ Music, and Bilibili playback, plus a web console.
Ein plattformübergreifender Musikbot für TeamSpeak 3/6 mit Netease Cloud Music, QQ Music und Bilibili sowie Webkonsole.
Contributors · 贡献者
感谢通过 PR 改进 WebSpeak 的贡献者。以下按 GitHub 的合并记录列出。
- LainHE — PR #2 改进浏览器端报错翻译;PR #8 修正缩放、浮动布局和首页脚注。
- TimmySheep — 已合并 PR #13、#15–#24,涉及 TS6 既有屏幕共享发现、屏幕比例、移动端语音/常亮/皮肤菜单、身份频道选项、PWA/主题、聊天历史、成员音频状态和麦克风权限等改进。
- yichen11818 — PR #25 支持通过 TeamSpeak 注册昵称连接,并在设置、收藏和邀请中保留昵称目标。
许可证 · License · Lizenz · Лицензия · ライセンス
WebSpeak 使用 GNU Affero General Public License v3.0 only 发布。你可以使用、研究、修改和再分发本项目;如果修改后的版本通过网络向用户提供服务,需要按照 AGPL-3.0 向这些用户提供对应源代码。
WebSpeak is released under the GNU Affero General Public License v3.0 only. If a modified version is offered to users over a network, its corresponding source code must be offered under AGPL-3.0.
WebSpeak wird unter der GNU Affero General Public License v3.0 only veröffentlicht. Bei Bereitstellung einer veränderten Version über ein Netzwerk muss der entsprechende Quellcode unter AGPL-3.0 angeboten werden.
WebSpeak распространяется по лицензии GNU Affero General Public License v3.0 only. Если изменённая версия предоставляется пользователям через сеть, соответствующий исходный код должен быть доступен этим пользователям на условиях AGPL-3.0.
WebSpeak は GNU Affero General Public License v3.0 only の下で公開されています。変更版をネットワーク経由でユーザーに提供する場合は、対応するソースコードを AGPL-3.0 に従ってユーザーに提供する必要があります。