Connections & protocols

WebSocket handshake

A WebSocket handshake is the initial exchange that establishes a WebSocket connection and agrees to use the WebSocket protocol before application messages flow.

Also found under: Connection handshake, HTTP upgrade

How it works

In the familiar HTTP/1.1 form, the client requests a protocol upgrade and the server accepts it. Proxies must forward the connection correctly. A successful transport handshake is separate from application initialization and from permission to subscribe to a private channel.

In a Pubb integration

A Pubb connection includes the public app key in the socket URL. After connecting, clients follow Pubb's connection and subscription messages; restricted channel authorization happens as a separate step.

Connect a client

A practical example

If a socket cannot open behind your own proxy, inspect TLS and upgrade forwarding. If it opens but a private subscription fails, inspect channel authorization instead.