RFC 6455 Wire Protocol

WebSocket Protocol Specification

Detailed specification of the Pusher wire protocol v7, heartbeat mechanics, and message envelopes.

Endpoint & Handshake

Clients initiate an HTTP Upgrade over persistent TLS or cleartext WebSocket:

wss://ws.yourdomain.com/app/{public_key}?protocol=7&client=js

Connection Established Frame

Upon handshake approval, the server generates a unique socket_id:

{
  "event": "pusher:connection_established",
  "data": "{\"socket_id\":\"483920.198374\",\"activity_timeout\":120}"
}

Heartbeat Ping / Pong

Keepalives preserve TCP connections through load balancers and cellular towers:

// Client sends ping
{ "event": "pusher:ping", "data": {} }

// Server replies immediately
{ "event": "pusher:pong", "data": {} }