TsgcWebSocketProxyServer › Properties › Active
Starts or stops the proxy, opening the listening sockets that accept downstream WebSocket clients.
property Active: Boolean read GetActive write SetActive default False;
False
Set Active to True to make the proxy start listening on the configured Port (and any additional Bindings); each accepted WebSocket client then gets its own connection to the upstream server defined in Proxy. Setting it back to False stops the listener and closes every active downstream client as well as the matching upstream link. The switch is executed in the calling thread, so the method blocks until the listener is fully up or down. Configure Proxy before activating so every new session knows where to forward traffic.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Port := 80;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;