TsgcWebSocketProxyServerProperties › Bindings

Bindings Property

Collection of IP/Port pairs the proxy listens on for incoming downstream WebSocket clients.

Syntax

property Bindings: TIdSocketHandles read GetBindings write SetBindings;

Default Value

— (empty; proxy falls back to Port on all interfaces)

Remarks

Add one entry per IP/Port combination the proxy must listen on. Each entry exposes IP, Port and IPVersion; when the collection is empty the proxy binds to every interface on Port. Use Bindings to expose both a plain and a TLS endpoint from the same proxy instance while forwarding all traffic to the single upstream server defined in Proxy, or to restrict the proxy to one physical interface. Call Bindings.Clear() after stopping the proxy if you plan to reassign the listening endpoints before restarting.

Example


oProxy := TsgcWebSocketProxyServer.Create(nil);
With oProxy.Bindings.Add do
begin
  IP := '127.0.0.1';
  Port := 80;
end;
With oProxy.Bindings.Add do
begin
  IP := '127.0.0.1';
  Port := 443;
end;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;

Back to Properties