Class WebSocketFrameEncoder
Encodes WebSocketFrame values to RFC 6455 wire bytes.
Inherited Members
Namespace: Titanium.Web.Proxy
Assembly: Titanium.Web.Proxy.dll
Syntax
public static class WebSocketFrameEncoder
Methods
| Edit this page View SourceEncode(WebsocketOpCode, ReadOnlySpan<byte>, bool, bool, uint)
Builds a single WebSocket frame.
Declaration
public static byte[] Encode(WebsocketOpCode opCode, ReadOnlySpan<byte> payload, bool mask, bool isFinal = true, uint maskKey = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| WebsocketOpCode | opCode | Frame opcode. |
| ReadOnlySpan<byte> | payload | Unmasked payload. |
| bool | mask | When true, apply a masking key (required client→server). |
| bool | isFinal | FIN bit. |
| uint | maskKey | Optional fixed mask key (tests); when 0 a random key is used. |
Returns
| Type | Description |
|---|---|
| byte[] |