Table of Contents

TTMSFNCWebSocketHandshakeRequest Class

Represents the client handshake request sent to upgrade an HTTP connection to a WebSocket connection. Holds the target port and any extra headers, and serializes the request line and headers to a string list.

API unit family: TMSFNCWebSocketClient Inherits from: TTMSFNCWebSocketRequest

Syntax

TTMSFNCWebSocketHandshakeRequest = class(TTMSFNCWebSocketRequest)

Properties

Name Description
ExtraHeaders Additional headers appended to the handshake request after the standard headers. Assigning replaces the current contents.
Port Port of the server the handshake targets. Used to build the Host header; the port is omitted from the header for the standard ports 80 and 443.

Methods

Name Description
GenerateKey Generates a new random, base64-encoded key suitable for the Sec-WebSocket-Key header.
ToStrings Serializes the request line and all handshake headers into . The list is cleared first; a missing resource defaults to / and a missing key is generated automatically. Any ExtraHeaders are appended last.