TsgcWebSocketProxyServerProperties › FallBack

FallBack Property

Provides alternative transports (Flash, Server-Sent Events) for browsers that do not support native WebSockets.

Syntax

property FallBack: TsgcWSFallBack_Options read FFallBack write SetFallBack;

Default Value

Flash=False, ServerSentEvents.Enabled=False

Remarks

Enable Flash to allow browsers without native WebSocket implementation but with Flash enabled to use Flash as transport for the downstream connection. Enable ServerSentEvents.Enabled to let the proxy push events to browser clients using the HTML5 SSE specification; the Retry sub-property sets the interval in seconds before the browser tries to reconnect (3 by default). Fall-backs are negotiated transparently on the first request, so traffic is still forwarded to the upstream server defined in Proxy regardless of the transport finally used with the client.

Example


oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.FallBack.ServerSentEvents.Enabled := true;
oProxy.FallBack.ServerSentEvents.Retry := 3;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;

Back to Properties