Pusher Channels API
Connect to Pusher Channels from Delphi/C++Builder — public channels, presence channels and HMAC-signed private channels in one typed component.
Connect to Pusher Channels from Delphi/C++Builder — public channels, presence channels and HMAC-signed private channels in one typed component.
Typed Delphi/C++Builder client for the Pusher Channels WebSocket protocol — subscribes to public, private and presence channels and routes events through typed handlers.
TsgcWSAPI_Pusher
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Pair with TsgcWebSocketClient targeting ws.pusherapp.com, set Pusher.Key (and Pusher.Secret for private/presence), then call Subscribe per channel.
uses
sgcWebSocket, sgcWebSocket_API_Pusher;
var
WSClient: TsgcWebSocketClient;
Pusher: TsgcWSAPI_Pusher;
begin
WSClient := TsgcWebSocketClient.Create(nil);
Pusher := TsgcWSAPI_Pusher.Create(nil);
Pusher.Client := WSClient;
Pusher.Pusher.AppKey := 'your-app-key';
Pusher.Pusher.Secret := 'your-app-secret';
WSClient.Active := True;
Pusher.Subscribe('public-channel');
Pusher.Subscribe('private-orders');
Pusher.Subscribe('presence-chat');
end;
// uses: sgcWebSocket, sgcWebSocket_API_Pusher
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Pusher *Pusher = new TsgcWSAPI_Pusher(this);
Pusher->Client = WSClient;
Pusher->Pusher->AppKey = "your-app-key";
Pusher->Pusher->Secret = "your-app-secret";
WSClient->Active = true;
Pusher->Subscribe("public-channel");
Pusher->Subscribe("private-orders");
Implements the Pusher WebSocket protocol with built-in HMAC signing for private and presence channels.
Subscribe with a channel name — the component routes public-*, private-* and presence-* channels to the right auth scheme automatically.
Set Pusher.AppKey and Pusher.Secret to sign pusher:subscribe requests for private and presence channels with HMAC-SHA256.
Bind to Pusher.Subscribe, OnPusherEvent, OnPusherSubscriptionSucceeded and OnPusherSubscriptionError for per-channel state and payload handling.
The Pusher protocol negotiates an activity_timeout; the component schedules client pings and resubscribes to every active channel on reconnect.
Point the underlying TsgcWebSocketClient at the cluster-appropriate host (ws-eu.pusher.com, ws-ap1.pusher.com, ...) per your Pusher app settings.
On presence/private channels you can trigger client events via Pusher.TriggerEvent — useful for peer-to-peer signalling without a server round trip.
Authoritative sources for the APIs this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — API_Pusher Full property, method and event reference for this component. | Open | |
| Free Trial — sgcWebSockets Download the trial package to subscribe to Pusher Channels from Delphi. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |