Table of Contents

TWebSocketUpgrader Class

Upgrades an HTTP request to a WebSocket connection.

Remarks

Instances are created by TWebSocketMiddleware and made available in the request context, so applications normally retrieve the IWebSocketUpgrader interface from the context instead of creating this class directly.

Syntax

Unit: Sparkle.Middleware.WebSocket

TWebSocketUpgrader = class(TInterfacedObject, IWebSocketUpgrader);

Constructors

Name Description
Create Creates a new upgrader for the specified request context.

Methods

Name Description
IsWebSocketRequest Indicates whether the request is a valid WebSocket handshake and can be upgraded.
Upgrade Upgrades the connection to the WebSocket protocol, answering the handshake with a 101 status code.