TsgcWebSocketProxyServer › Properties › Proxy
Identifies the upstream target — the real WebSocket/TCP server to which every accepted client is transparently forwarded.
property Proxy: TsgcWSProxyServer_Options read FProxy write SetProxy;
Host='127.0.0.1', Port=80, MessageType=mtText, TLS=False
Proxy describes the upstream target — the real WebSocket/TCP server that this component forwards traffic to. It is not an HTTP CONNECT proxy configuration; TsgcWebSocketProxyServer itself is the proxy, and every accepted downstream client causes a matching outbound connection to be opened to this target. Configure the sub-properties before activating the component: Host is the hostname or IP of the upstream server (default 127.0.0.1), Port is the TCP port it listens on (default 80), MessageType selects whether forwarded text is relayed as mtText or mtBinary frames, and TLS set to True tells the proxy to open the upstream leg over a secure TLS/SSL connection (wss://). The downstream TLS endpoint exposed to clients is configured independently via SSL and SSLOptions, so a plain downstream port can be mapped to a secure upstream server (or vice versa).
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Port := 80;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 443;
oProxy.Proxy.TLS := true;
oProxy.Proxy.MessageType := mtText;
oProxy.Active := true;