TsgcWebSocketProxyServer › Properties › LogFile
Writes every incoming and outgoing socket message to a log file for debugging and auditing.
property LogFile: TsgcWSLogFile read GetLogFile write SetLogFile;
Enabled=False, UnMaskFrames=True
Set LogFile.Enabled to True and LogFile.FileName to the full path of the log file; every message received from or sent to downstream clients is appended to the file, which is invaluable when tracing how a proxied session reaches the upstream server defined in Proxy. UnMaskFrames (default True) stores the payload unmasked for easier inspection. The file is opened on demand and closed on each write; avoid enabling the log on production proxies under heavy load as disk I/O will become a bottleneck.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.LogFile.FileName := 'c:\logs\proxy.log';
oProxy.LogFile.Enabled := true;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;