Module ws

Source
Expand description

WebSocket protocol support.

To setup a WebSocket, first do web socket handshake then on success convert Payload into a WsStream stream and then use WsWriter to communicate with the peer.

Structs§

CloseReason
Reason for closing the connection
Codec
WebSockets protocol codec
Dispatcher
Parser
A struct representing a WebSocket frame.

Enums§

CloseCode
Status code used to indicate why an endpoint is closing the WebSocket connection.
Frame
WebSocket frame
HandshakeError
Websocket handshake errors
Item
WebSocket continuation item
Message
WebSocket Message
OpCode
Operation codes as part of rfc6455.
ProtocolError
Websocket protocol errors

Functions§

handshake
Verify WebSocket handshake request and create handshake reponse.
handshake_response
Create websocket’s handshake response
hash_key
verify_handshake
Verify WebSocket handshake request.