Available on crate feature
ws
only.Expand description
WebSocket protocol implementation.
To setup a WebSocket, first perform the WebSocket handshake then on success convert Payload
into a
WsStream
stream and then use WsWriter
to communicate with the peer.
Structs§
- Close
Reason - Reason for closing the connection
- Codec
- WebSocket protocol codec.
- Dispatcher
- Parser
- A struct representing a WebSocket frame.
Enums§
- Close
Code - Status code used to indicate why an endpoint is closing the WebSocket connection.
- Frame
- A WebSocket frame.
- Handshake
Error - WebSocket handshake errors
- Item
- A WebSocket continuation item.
- Message
- A WebSocket message.
- OpCode
- Operation codes defined in [RFC 6455 §11.8].
- Protocol
Error - WebSocket protocol errors.
Functions§
- handshake
- Verify WebSocket handshake request and create handshake response.
- handshake_
response - Create WebSocket handshake response.
- hash_
key - Hashes the
Sec-WebSocket-Key
header according to the WebSocket spec. - verify_
handshake - Verify WebSocket handshake request.