Connect to the server
Clean up all resources
Disconnect from the server
Get the player ID assigned by the server
Get current connection state
Remove a message handler
Remove a state change handler
Register a handler for server messages
Register a handler for connection state changes
Send a typed message to the server
Optionaldata: unknown
WebSocket client with auto-reconnect, heartbeat keepalive, and typed message dispatch. Matches clik-server protocol.