pedestal

isak 2020-09-21T18:18:48.002200Z

There is something built in, but sometimes they still get closed by code outside your app (on the firewall, for example). One approach I've seen people take is to just send a {"type": "ka"} (ka = keepalive) message every 30 seconds, if no other message has been sent. Hasura does this for GraphQL subscriptions, for example.

isak 2020-09-21T18:19:54.002400Z

For another project I tried sending ping/pong messages (a special message type in the websocket spec), but it didn't change anything, and those messages don't appear as frames in the browser tooling

isak 2020-09-21T18:20:06.002600Z

(This was in .NET though, not pedestal)