Skip to main content

rs_teststand_websocket/
lib.rs

1//! Serve a TestStand™ engine over `WebSocket`, and connect to one.
2//!
3//! Split out of `rs-teststand-bridge` so that crate stays what its name says: a
4//! protocol-neutral helper. The wire vocabulary lives there and is used here
5//! unchanged, so a front end learns the engine's model rather than either
6//! crate's.
7//!
8//! # What this does not do
9//!
10//! It does not implement `WebSocket`. Framing, masking, fragmentation, UTF-8
11//! validation of text frames, the opening handshake and automatic pong replies
12//! all belong to `tungstenite`, which is the reference implementation in Rust
13//! and has been through the Autobahn suite. Reimplementing any of that here
14//! would mean owning a protocol this crate only needs to speak.
15//!
16//! What is here is the part above the protocol: which frames carry commands,
17//! how a reply is told apart from an event, what limits a host imposes, and the
18//! obligations RFC 6455 places on an application rather than on a framing
19//! library. Those are section 5.5's control frame limit, section 5.5.1's
20//! closing handshake, and section 7.2.3's reconnection delay.
21//!
22//! # The two halves
23//!
24//! [`WebSocketBridge`] is the server a host runs. [`Client`] is the other end,
25//! for a panel or a test.
26
27pub mod client;
28pub mod server;
29
30pub use client::{Backoff, Client, Inbound, MAX_CONTROL_PAYLOAD};
31pub use server::{Options, Request, WebSocketBridge};