Ping Pong

Note: When using the provided JS this section can be ignored.

LiquidTap requires some activity on the websocket every 120 seconds or it will forcibly close the connection. To ensure the connection doesn’t get closed, it is advisable to send a ping every 60 seconds. In the provided JS library this is taken care of through a local interval timer. However, when building a custom integration this will need to be taken into account.

PING (SEND EVERY 60 SECONDS)

{"event":"pusher:ping","data":{}}

PONG (SERVER RESPONSE)

{"event":"pusher:pong","data":{}}

It is the responsibility of the client to initiate the ping/pong event. The server will never ping the client.

const ws = new WebSocket('wss://tap.liquid.com/app/LiquidTapClient');

const tapPing = {
  event: "pusher:ping",
  data: { }
}
const tapPingPayload = JSON.stringify(tapPing);

setInterval(
  () => (ws.send(tapPingPayload)),
  60000
);

Last updated