How to implement free of charge ping pong in cloudflare Durable Object Websocket
I want to implement ping pong in my DO websocket so it's possible to know when the client is offline, since the websocket alone does not tells that.
But I want to avoid extra charge for each ping/pong.
Cloudflare says pings are not charged. Consider the following:
https://developers.cloudflare.com/durable-objects/platform/pricing/
Here is the protocol reference link:
https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2
How can I implement that opcodes in both DO and client to ensure Cloudflare will understand the messages as the ping protocol?
My client is native browser websocket
But I want to avoid extra charge for each ping/pong.
Cloudflare says pings are not charged. Consider the following:
https://developers.cloudflare.com/durable-objects/platform/pricing/
Here is the protocol reference link:
https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2
How can I implement that opcodes in both DO and client to ensure Cloudflare will understand the messages as the ping protocol?
My client is native browser websocket
new Webocket()