Skip to main content

Module sec_protocols

Module sec_protocols 

Source
Expand description

The Sec-WebSocket-Protocol value that carries the initConnection message and the auth token (encodeSecProtocols and decodeSecProtocols): the UTF-8 of JSON.stringify({initConnectionMessage, authToken}), base64 encoded, then URI encoded.

Functionsยง

decode
Decodes a header value into the JSON it carries, as JSON.parse returns it: decodeSecProtocols does not validate it.
encode