TsgcWebSocketProxyServer › Properties › Options
Bundles miscellaneous proxy behaviour flags: fragment handling, timeouts, HTTP test pages and UTF-8 validation.
property Options: TsgcWSOptionsServer read FOptions write SetOptions;
FragmentedMessages=frgOnlyBuffer, HTMLFiles=True, JavascriptFiles=True, ReadTimeOut=10, WriteTimeOut=0
FragmentedMessages controls how fragmented frames received from downstream clients are delivered: frgOnlyBuffer (default) buffers the message until complete and raises OnMessage/OnBinary; frgOnlyFragmented raises OnFragmented for every fragment; frgAll raises both. HTMLFiles and JavascriptFiles let the proxy serve the built-in browser test pages and JavaScript client (enabled by default). RaiseDisconnectExceptions throws when a disconnection is caused by a protocol error. ReadTimeOut is the polling interval in milliseconds (10 by default); WriteTimeOut (Windows only) caps the time a write can block (0 means no limit). ValidateUTF8 rejects text messages containing invalid UTF-8 sequences (disabled by default). Software holds the value sent in the HTTP Server header.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Options.FragmentedMessages := frgOnlyBuffer;
oProxy.Options.ValidateUTF8 := true;
oProxy.Options.HTMLFiles := false;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;