Discuss this help topic in SecureBlackbox Forum


TElWebSocketBase     See also     

Filter: C#/Java  VB.NET  Pascal  C++  PHP  

Generates the content of the header field used to initiate WebSocket handshake on server's side.


    static string CreateWebSocketAccept(string Key);

    Shared Function CreateWebSocketAccept(ByVal Key As String) As String

    class function CreateWebSocketAccept(const Key : string) : string;

    static void CreateWebSocketAccept(const std::string &Key, std::string &OutResult);

    string CreateWebSocketAccept(string $Key)


  • Key - the contents of the Sec-WebSocket-Key field (randomly generated by a client).

Return value

    Returns the string containing the Sec-WebSocket-Accept value.


    According to RFC 6455, a WebSocket client's handshake is just an HTTP Upgrade request. The client's handshake request should contain the Sec-WebSocket-Key header field containing a randomly generated 16-byte value. To accept the handhsake, the server generates a Sec-WebSocket-Accept header field basing on the received Sec-WebSocket-Key value. Use this method to generate the value of the Sec-WebSocket-Accept field of the server's handshake response.

See also:     Close     Constructor    

Discuss this help topic in SecureBlackbox Forum