Skip to main content

Module websocket

Module websocket 

Source
Expand description

WebSocket (RFC 6455) client.

tokio-tungstenite’s connect_async performs the whole HTTP Upgrade handshake, including generating the 16-byte Sec-WebSocket-Key nonce and verifying the server’s Sec-WebSocket-Accept, and its Role::Client framing masks every outgoing frame with a fresh 32-bit key as RFC 6455 §5.3 requires. What is written here is the part NetGet owns: turning the offered subprotocols and extra headers into the request, and turning received frames into events the model answers with actions.

ws:// only. The tokio-tungstenite dependency is built without a TLS backend, so wss:// is refused with a clear error rather than silently downgraded.

Re-exports§

pub use actions::WebSocketClientProtocol;

Modules§

actions
WebSocket (RFC 6455) client actions, events and metadata.

Structs§

WebSocketClient

Constants§

DEFAULT_PERMESSAGE_DEFLATE
Whether the client offers RFC 7692 permessage-deflate (permessage_deflate).