Recommendation on how to document Websocket API
<p>I've written a Websocket-API using socket.io.</p>

<p>Let's say that after establishing the connection the server waits for a <code>login</code>-event with a payload like <code>{username: String, password: String}</code>.</p>

<p>The server then answers with the events <code>login:accept</code> or <code>login:deny</code>.</p>

<p>Only if the login was successful the server then responds to an event <code>tweets:get</code> with an event <code>tweets</code> (that has an array of tweets as payload).</p>

<p>Is there a standardized way to document APIs like this one? Do you have any recommendations and experiences?</p>