TsgcWebSocketClient | WebSocket HandShake

WebSocket protocol uses an HTTP HandShake to upgrade from HTTP Protocol to WebSocket protocol. This handshake is handled internally by TsgcWebSocket Client component, but you can add your custom HTTP headers if server requires some custom HTTP Headers info.

Example: if you need to add this HTTP Header "Client: sgcWebSockets"


procedure OnHandshake(Connection: TsgcWSConnection; var Headers: TStringList);
begin
  Headers.Add('Client: sgcWebSockets');
end;

You can check HandShake string before is sent to server using OnHandShake event too.