|
static string | CalculateWebSocketKey () |
| Calculates a random WebSocket key that can be used to initiate a WebSocket handshake.
|
|
static string | ComputeSocketAcceptString (string secWebSocketKey) |
| Computes a WebSocket accept string from a given key.
|
|
static async Task< string > | ReadHttpHeaderAsync (System.IO.Stream stream, CancellationToken token) |
| Reads an http header as per the HTTP spec.
|
|
static bool | IsWebSocketUpgradeRequest (String header) |
| Decodes the header to detect is this is a web socket upgrade response.
|
|
static string | GetPathFromHeader (string httpHeader) |
| Gets the path from the HTTP header.
|
|
static IList< string > | GetSubProtocols (string httpHeader) |
|
static string | ReadHttpResponseCode (string response) |
| Reads the HTTP response code from the http response string.
|
|
static async Task | WriteHttpHeaderAsync (string response, System.IO.Stream stream, CancellationToken token) |
| Writes an HTTP response string to the stream.
|
|
◆ CalculateWebSocketKey()
static string Nakama.Ninja.WebSockets.HttpHelper.CalculateWebSocketKey |
( |
| ) |
|
|
inlinestatic |
Calculates a random WebSocket key that can be used to initiate a WebSocket handshake.
- Returns
- A random websocket key
◆ ComputeSocketAcceptString()
static string Nakama.Ninja.WebSockets.HttpHelper.ComputeSocketAcceptString |
( |
string | secWebSocketKey | ) |
|
|
inlinestatic |
Computes a WebSocket accept string from a given key.
- Parameters
-
secWebSocketKey | The web socket key to base the accept string on |
- Returns
- A web socket accept string
◆ GetPathFromHeader()
static string Nakama.Ninja.WebSockets.HttpHelper.GetPathFromHeader |
( |
string | httpHeader | ) |
|
|
inlinestatic |
Gets the path from the HTTP header.
- Parameters
-
httpHeader | The HTTP header to read |
- Returns
- The path
◆ GetSubProtocols()
static IList< string > Nakama.Ninja.WebSockets.HttpHelper.GetSubProtocols |
( |
string | httpHeader | ) |
|
|
inlinestatic |
◆ IsWebSocketUpgradeRequest()
static bool Nakama.Ninja.WebSockets.HttpHelper.IsWebSocketUpgradeRequest |
( |
String | header | ) |
|
|
inlinestatic |
Decodes the header to detect is this is a web socket upgrade response.
- Parameters
-
- Returns
- True if this is an http WebSocket upgrade response
◆ ReadHttpHeaderAsync()
static async Task< string > Nakama.Ninja.WebSockets.HttpHelper.ReadHttpHeaderAsync |
( |
System.IO.Stream | stream, |
|
|
CancellationToken | token ) |
|
inlinestatic |
Reads an http header as per the HTTP spec.
- Parameters
-
stream | The stream to read UTF8 text from |
token | The cancellation token |
- Returns
- The HTTP header
◆ ReadHttpResponseCode()
static string Nakama.Ninja.WebSockets.HttpHelper.ReadHttpResponseCode |
( |
string | response | ) |
|
|
inlinestatic |
Reads the HTTP response code from the http response string.
- Parameters
-
response | The response string |
- Returns
- the response code
◆ WriteHttpHeaderAsync()
static async Task Nakama.Ninja.WebSockets.HttpHelper.WriteHttpHeaderAsync |
( |
string | response, |
|
|
System.IO.Stream | stream, |
|
|
CancellationToken | token ) |
|
inlinestatic |
Writes an HTTP response string to the stream.
- Parameters
-
response | The response (without the new line characters) |
stream | The stream to write to |
token | The cancellation token |
The documentation for this class was generated from the following file: