Yeah, I did miss the import from protocol.py. I knew it couldn't be just 60 lines but got excited and hit enter. Regardless, to your earlier point, I don't dig into the protocol's details often and just rely on the library.
Micropython and this WebSocket client DO run on the ESP8266. As noted before, I'm using these libraries on a D1 mini. I don't know the specifics of the memory footprint as I stay away from applications where I'm up against the wall of my device's capabilities. But the point stands that there's plenty enough space on the ESP8266 for the glorious luxury of micropython.