Skip to content

v0.2.2

Choose a tag to compare

@rudyberends rudyberends released this 07 Jun 14:15
· 4 commits to main since this release
fix(websocket): request Sonos subprotocol via ws protocols arg

The S2 WebSocket sent 'Sec-WebSocket-Protocol: v1.api.smartspeaker.audio'
as a raw header. ws only tracks a requested-protocol set when the
subprotocol is passed as the constructor's protocols argument; with the
header form that set is empty, so when Sonos echoes the subprotocol in its
101 response ws aborts with 'Server sent a subprotocol but none was
requested'. The handshake reached 101 but then errored — observed in the
field as 'Failed to connect (upgrade 101 Switching Protocols)', leaving
the state controller in an endless reconnect loop and no external events.

Pass the subprotocol as the protocols argument instead.

Bump 0.2.2.