Files
floci/docs
Mario Toffia c4027bbf54 feat(iot): MQTT over WebSocket at /mqtt (#3150)
* test(iot): MQTT over WebSocket at /mqtt, failing

* feat(http): echo MQTT WebSocket subprotocols

* feat(iot): MQTT over WebSocket at /mqtt

Bridges a WebSocket upgrade on /mqtt (HTTP and HTTPS) onto the broker's
plaintext listener, so wss://host:443/mqtt works on the 443:4566 mapping
with the same certificate as HTTPS and no extra listener or config.

* docs(iot): MQTT over WebSocket at /mqtt

* feat(iot): do not queue the /mqtt handshake behind ordered blocking tasks

* fix(iot): forward only binary WebSocket frames to the broker

One frame handler decides per frame: text closes with 1003, binary and
continuation frames are written to the broker socket, control frames are
left to Vert.x. Nothing else reads the frames, so a text payload can never
reach the MQTT stream.

* test(iot): AWS contract and framing tests for MQTT over WebSocket

Handshake: only GET upgrades (405), unsupported version is 426, each MQTT
subprotocol name is echoed and the first supported offer wins, ping gets
pong, non-upgrade requests fall through. Framing (MQTT 3.1.1 section 6):
a CONNECT split across two frames, two packets in one frame, garbage
bytes and a frame over the transport limit. Session semantics as on AWS:
MQTT 5 over wss, client id takeover across transports, retained messages,
QoS 2 disconnects, shadow topics, topic rules, keep-alive pings and the
IoT Data connection APIs on a WebSocket session.

* test(iot): log the tolerated exceptions in the WebSocket contract tests

* test(iot): pin the MQTT TLS port and the unrelated-subprotocol handshake

The profile pins floci.services.iot.mqtt.tls-port now that #3142 opens 8883
whenever TLS is on. A client offering only graphql-ws on an API Gateway
WebSocket path still connects, with no subprotocol echoed: the server-wide
MQTT list does not affect other WebSocket routes.

* test(iot): pin the deployment claims of MQTT over WebSocket

Every claim the docs and comments make now has a test that fails without
the behaviour: ws and wss share one port through TlsProxyServer (the
443:4566 path), a hostname learned by ensureHost serves /mqtt to a client
verifying that name, the first upgrade starts a lazy broker (also eight at
once, and again after a stop), a text frame or an abrupt TCP drop after a
live CONNECT frees the broker session, 30 connect and disconnect cycles
leave nothing behind, and the burst is 1000 messages.

* test(iot): force-close the Paho client the broker stop left behind

* test(iot): wait for the dropped session before closing the Paho client
2026-09-09 01:10:29 -05:00
..
2026-03-15 17:43:56 -05:00