Skip to main content

accept_key

Function accept_key 

Source
pub(super) fn accept_key(key: &[u8]) -> String
Expand description

The value of the Sec-WebSocket-Accept header for the Sec-WebSocket-Key of a client, see RFC 6455, section 4.2.2: the base64 of the SHA-1 of the key and a fixed GUID.

The hash is an echo of the protocol, which tells the client that the server speaks WebSocket. It is no security boundary, so SHA-1 being broken for signatures does not matter here, and it is not worth the crates of a hash library.