computeWebSocketAccept
computeWebSocketAccept(
key):Promise<string>
Defined in: packages/net-websocket/src/handshake/websocket-accept.ts:21
The Sec-WebSocket-Accept value proving a server read the client’s
Sec-WebSocket-Key (RFC 6455 §4.2.2): the base64 SHA-1 of the key followed
by the protocol’s GUID.
Not a security measure — SHA-1 is used here only because the protocol fixes it — but a handshake whose value does not match must be refused.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string>
Example
Section titled “Example” await computeWebSocketAccept("dGhlIHNhbXBsZSBub25jZQ=="); // "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" ```;