Websockets are a natively supported way for a server communicating with a player in Minecraft. The official Script API of Minecraft however is generally preferred over using a websocket connection.
The Sonos S2 update, released June 2020, still works with this API. However, it might break in the future if and when Sonos decide to drop UPnP as the control protocol. Feel free to use it as you ...