The new Voelin UI needs Discord-like features that TeamSpeak does not have. They run on tsgw, so the protocol grows, additively within v1: - capabilities in hello (server-wide) and auth_ok (per user, with admin) - query_history with before/after id and time cursors, optional limit, topic filter; sync by revision for new and changed messages - post (optionally into a topic), pins, reactions with per-user counts, topics, scheduled events with RSVP and reminders, the stream directory, the activity feed, runtime configuration and permission rules - history entries carry topic, reactions, pinned flag and revision; old clients ignore the extra fields Old clients never see a new message type: extension pushes need enable or a subscribe request. New error codes and enums have an unknown fallback so older clients keep parsing newer gateways. The optional client feature adds a typed client (request/answer by envelope id, typed pushes), shared by the app engine and the gateway's integration tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
39 lines
1.5 KiB
Rust
39 lines
1.5 KiB
Rust
//! Wire protocol of `tsgw`, the companion gateway that gives app users
|
|
//! invisible presence and channel chat without joining voice.
|
|
//!
|
|
//! Transport: WebSocket, subprotocol [`SUBPROTOCOL`], one JSON [`Envelope`]
|
|
//! per text frame. Within version 1 changes are additive only: new message
|
|
//! types and optional fields. Unknown fields must be ignored. The gateway
|
|
//! answers message types it does not know with [`ErrorCode::UnknownType`]
|
|
//! and keeps the connection; it only pushes newer message types to clients
|
|
//! that asked for them.
|
|
//!
|
|
//! Authentication proves ownership of a TeamSpeak identity: the gateway sends
|
|
//! a nonce in [`ServerMsg::Hello`], the client answers with
|
|
//! [`ClientMsg::Auth`], an ECDSA P-256 signature over [`challenge`] made with
|
|
//! the identity's private key. The unique id is derived from the public key,
|
|
//! exactly as the TeamSpeak server does.
|
|
//!
|
|
//! Besides presence and chat, gateways can offer pins, reactions, topics,
|
|
//! scheduled events, a directory of running streams, an activity feed and
|
|
//! runtime administration; [`ServerMsg::Hello`] lists what is enabled
|
|
//! ([`feature`]). The `client` feature adds a typed client ([`client`]).
|
|
|
|
mod auth;
|
|
#[cfg(feature = "client")]
|
|
pub mod client;
|
|
mod messages;
|
|
mod types;
|
|
|
|
pub use auth::{
|
|
AuthError, MAX_CLOCK_SKEW_SECS, UniqueIds, challenge, identity_level, sign_challenge,
|
|
verify_auth,
|
|
};
|
|
pub use messages::*;
|
|
pub use types::*;
|
|
|
|
/// WebSocket subprotocol.
|
|
pub const SUBPROTOCOL: &str = "tsgw.v1+json";
|
|
/// Protocol version in every envelope.
|
|
pub const VERSION: u32 = 1;
|