Packets are used to communicate between the HTML5 client and the Golang server. The official listing for these packets can be found below. For non-login (L) packets - a token is required which is received when logging in. This token not only ensures that the user is authenticated, but it also ensures that players cannot send packets to the server on behalf of other players without their token.
It should be noted that sometimes packets will be received without an initial request. These have specific listeners setup on the client side. It should also be noted that an E packet can be sent in replace of the typical response for any request if an error occured while processing the request on the server.
Finally, the original sender's ID in both the client -> server and server -> client case pass the ID in the header - therefore it is not needed in the data parameters (with the exception of the server sending the ID in the login response packet).