title: Sending websocket ping/pong frame from browser
body: <p>I keep reading about ping/pong messages in websockets to keep the connection alive, but I'm not sure what they are.  Is it a distinct frame type? (I don't see any methods on a javascript WebSocket object in chrome related to ping-pong).  Or is it just a design pattern (e.g. I literally send &quot;ping&quot; or any other string to the server and have it respond).  Is ping-pong at all related to continuation frames?</p>
  <p>The reason I ask is I'm using a python framework that runs behind Mongrel2, so I'm wondering if there's a way to send Mongrel2 a specific ping/pong message that would tell it to keep the connection alive without my python app needing to worry about it.  Analogous to a having a separate HTTP method for it, I guess.  And I imagine a dedicated ping/pong message frame could be simpler (less load on server and network) than the string &quot;ping&quot;, though that probably wouldn't matter too much.</p>
  <p>EDIT: I just looked at <a href="https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2" rel="noreferrer">RFC 6455</a> and it looks like Ping and Pong are definitely control frame types with their own opcodes.  So how do I send a Ping frame from javascript in Chrome?</p>