少于1分钟
https://nginx.org/en/docs/stream/ngx_stream_mqtt_preread_module.html
The ngx_stream_mqtt_preread_module
module (1.23.4) allows extracting information from the CONNECT message of the Message Queuing Telemetry Transport protocol (MQTT) versions 3.1.1 and 5.0, for example, a username or a client ID.
This module is available as part of our commercial subscription.
mqtt_preread on;
return $mqtt_preread_clientid;
Syntax:mqtt_preread on | off;
Default: mqtt_preread off;
Context: stream
, server
Enables extracting information from the MQTT CONNECT message at the preread phase.
$mqtt_preread_clientid
the clientid
value from the CONNECT message
$mqtt_preread_username
the username
value from the CONNECT message