Socketelx.WsHandler (socketelx v0.2.1)

Copy Markdown View Source

Implements the client-facing side of the Pusher protocol over a raw cowboy websocket (not Phoenix Channels — a different wire format).

Handles: pusher:subscribe / unsubscribe / ping, private + presence channel auth, client events, and delivering events pushed in via the HTTP trigger endpoint (see Socketelx.HttpRouter) or from other nodes.

Receives the instance name via cowboy route opts (set up in Socketelx), so the same handler code serves any number of independently-configured instances. Everything that must be shared between nodes goes through Socketelx.Cluster.