Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Nov 24, 2025

Addresses #15001

The Web MQTT handler only accepts the mqtt WebSocket subprotocol, rejecting clients that request mqttv3.1. This prevents some MQTT clients from establishing WebSocket connections.

This change updates the protocol negotiation to accept either mqtt or mqttv3.1 subprotocols. The handler uses lists:search/2 to find the first matching protocol and echoes that exact value back in the sec-websocket-protocol response header, ensuring proper protocol negotiation with the client.


This is an automatic backport of pull request #15008 done by Mergify.

Addresses #15001

The Web MQTT handler only accepts the `mqtt` WebSocket subprotocol,
rejecting clients that request `mqttv3.1`. This prevents some MQTT
clients from establishing WebSocket connections.

This change updates the protocol negotiation to accept either `mqtt` or
`mqttv3.1` subprotocols. The handler uses `lists:search/2` to find the
first matching protocol and echoes that exact value back in the
`sec-websocket-protocol` response header, ensuring proper protocol
negotiation with the client.

(cherry picked from commit 12a6645)
@michaelklishin michaelklishin added this to the 4.2.2 milestone Nov 24, 2025
@michaelklishin
Copy link
Collaborator

@Mergifyio backport v4.1.x

@mergify
Copy link
Author

mergify bot commented Nov 24, 2025

backport v4.1.x

✅ Backports have been created

@michaelklishin michaelklishin merged commit 1228259 into v4.2.x Nov 25, 2025
289 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-15008 branch November 25, 2025 03:09
michaelklishin added a commit that referenced this pull request Nov 25, 2025
Support `mqttv3.1` WebSocket subprotocol in addition to `mqtt` (backport #15008) (backport #15009)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants