How do I build a WebSocket client library?

I recently extracted a websocket lib for HA that I published on hex: Hassock — hassock v0.1.3

This uses the newer HA command that uses diff’s for efficiency with an optional ETS cache for faster queries without sending everything over the websocket connection.