C# Class Microsoft.AspNetCore.WebSockets.Protocol.HandshakeHelpers

ファイルを表示 Open project: AdaptiveConsulting/ReactiveTraderCloud Class Usage Examples

Public Methods

Method Description
CheckSupportedWebSocketRequest ( string method, string>.IEnumerable headers ) : bool
CreateRequestKey ( ) : string

"The value of this header field MUST be a nonce consisting of a randomly selected 16-byte value that has been base64-encoded."

CreateResponseKey ( string requestKey ) : string

"...the base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-Key| (as a string, not base64-decoded) with the string '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'"

GenerateResponseHeaders ( string key, string subProtocol ) : string>>.IEnumerable
IsRequestKeyValid ( string value ) : bool

Validates the Sec-WebSocket-Key request header "The value of this header field MUST be a nonce consisting of a randomly selected 16-byte value that has been base64-encoded."

IsResponseKeyValid ( string value ) : bool

Method Details

CheckSupportedWebSocketRequest() public static method

public static CheckSupportedWebSocketRequest ( string method, string>.IEnumerable headers ) : bool
method string
headers string>.IEnumerable
return bool

CreateRequestKey() public static method

"The value of this header field MUST be a nonce consisting of a randomly selected 16-byte value that has been base64-encoded."
public static CreateRequestKey ( ) : string
return string

CreateResponseKey() public static method

"...the base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-Key| (as a string, not base64-decoded) with the string '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'"
public static CreateResponseKey ( string requestKey ) : string
requestKey string
return string

GenerateResponseHeaders() public static method

public static GenerateResponseHeaders ( string key, string subProtocol ) : string>>.IEnumerable
key string
subProtocol string
return string>>.IEnumerable

IsRequestKeyValid() public static method

Validates the Sec-WebSocket-Key request header "The value of this header field MUST be a nonce consisting of a randomly selected 16-byte value that has been base64-encoded."
public static IsRequestKeyValid ( string value ) : bool
value string
return bool

IsResponseKeyValid() public static method

public static IsResponseKeyValid ( string value ) : bool
value string
return bool