TsgcWebSocketProxyServer › Events › OnStartup
Fires after the proxy server has started and is ready to accept connections.
property OnStartup: TNotifyEvent;
// TNotifyEvent = procedure(Sender: TObject) of object
—
OnStartup is raised in the main thread once the listener has been bound and the proxy server starts accepting new downstream connections. The Sender parameter is the TsgcWebSocketProxyServer instance. It is a convenient place to log the server state or publish startup information; heavy initialization should still be performed before Active is set to True because OnStartup runs after the server is already listening. Note that the upstream TCP destination is not contacted here; it is opened per session from OnConnect using Proxy.Host and Proxy.Port.
procedure OnStartup(Sender: TObject);
begin
WriteLn('#server started');
end;