TsgcWebSocketProxyServer › Properties › Port
TCP port on which the proxy accepts incoming downstream WebSocket connections.
property Port: Integer read GetPort write _SetPort;
80
Set Port before activating the proxy. Any value between 1 and 65535 is accepted, but ports below 1024 normally require elevated privileges on Unix and firewall rules on Windows. Port is the downstream endpoint where browser/WebSocket clients connect — it is independent from Proxy.Port, which points to the upstream server. When the proxy listens on several endpoints use Bindings instead; assigning Port is equivalent to a single binding on 0.0.0.0. If you change Port after stopping the proxy, call Bindings.Clear() first so the previous handle is released.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Port := 8080;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 9000;
oProxy.Active := true;