WebSocket
Websocket is the main transport in Centrifugo. It's a very efficient low-overhead protocol on top of TCP.
The biggest advantage is that Websocket works out of the box in all modern browsers and almost all programming languages have Websocket implementations. This makes Websocket a universal transport that can be used to connect to Centrifugo from almost everywhere.
Default WebSocket connection endpoint in Centrifugo is:
/connection/websocket
So to connect:
Connect to local Centrifugo with JavaScript SDK
const client = new Centrifuge('ws://localhost:8000/connection/websocket', {
// token: ?,
// getToken: ?
});
client.connect();
Options
websocket_message_size_limit
Default: 65536 (64KB)
Maximum allowed size of a message received from WebSocket connection in bytes.