Expand description
WebSocket transport support.
This module provides WebSocket upgrade handling for the server.
The WsIo adapter is provided by trojan-core::transport.
Structs§
- WsIo
- WebSocket stream adapter that exposes AsyncRead/AsyncWrite using binary frames.
Enums§
- WsInspect
- Result of inspecting buffered bytes for WebSocket upgrade.
Constants§
- INITIAL_
BUFFER_ SIZE - Initial buffer size for reading HTTP headers during WebSocket upgrade.
Functions§
- accept_
ws - Accept a WebSocket upgrade on the given stream.
- inspect_
mixed - Inspect buffered bytes for WebSocket upgrade in mixed mode.
- send_
reject - Send an HTTP 400 Bad Request response to reject the connection.