@seriousme/opifex@1.11.2Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
MQTT Server and Client on Deno, NodeJS and Bun
client
This module provides an MQTT Client interface see the /bin folder for examples
The Client class provides an MQTT Client that can be used to connect to a MQTT broker and publish/subscribe messages.
the default keepalive time
the default protocol level to connect with
the default MQTT URL to connect to
Protocol version 3.1 = 3 3.1.1 = 4 5.0 = 5
PublishParameters define how a message should be published
SubscribeParameters define how to subscribe to a topic
this can be any possible MQTT packet
Possible MQTT authentication results
Reverse lookup for AuthenticationResult
An AUTH packet is sent from Client to Server or Server to Client as part of an extended authentication exchange, such as challenge / response authentication. It is a Protocol Error for the Client or Server to send an AUTH packet if the CONNECT packet did not contain the same Authentication Method.
Client identifier that uniquely identifies a client
ConnackPacket is sent from the server to the client in response to a connect packet. It indicates that the connect is accepted.
ConnectPacket is sent from the client to the server to initiate a connection.
Decodes a variable-length encoded number from a byte array
DisconnectPacket is the final control packet sent from the client to the server. It indicates that the client is disconnecting cleanly.
Duplicate delivery flag
Encodes a number into a variable-length byte array using a modified base-128 encoding
Creates a stateful decoder function for processing variable-length encoded numbers
check for invalid topic characters
check for invalid topic filter characters
check for invalid UTF-8 characters
Interface for the result returned by the length decoder
Packet identifier, unique per client session
Reverse lookup for packet types
Array mapping MQTT packet types to their corresponding encode/decode handlers Index corresponds to packet type number.
Packet payload
PingreqPacket is a packet that is sent to the server to keep the connection alive
PingresPacket is an empty packet that is sent by the server in response to a PingreqPacket. It is used to indicate that the client is still connected to the server.
PubackPacket is sent to indicate publish complete (QoS 1)
Pubcomp is sent to indicate publish complete (QoS 2)
Pubrec is sent to indicate publish received (QoS 2)
Pubrel is sent to indicate publish release (QoS 2)
Quality of Service level
- administrativeAction
- badAuthenticationMethod
- badUserNameOrPassword
- banned
- clientIdentifierNotValid
- connectionRateExceeded
- continueAuthentication
- disconnectWithWillMessage
- grantedQos0
- grantedQos1
- grantedQos2
- implementationSpecificError
- keepAliveTimeout
- malformedPacket
- maximumConnectTime
- messageRateTooHigh
- noMatchingSubscribers
- noSubscriptionExisted
- normalDisconnection
- notAuthorized
- packetIdentifierInUse
- packetIdentifierNotFound
- packetTooLarge
- payloadFormatInvalid
- protocolError
- qosNotSupported
- quotaExceeded
- reAuthenticate
- receiveMaximumExceeded
- retainNotSupported
- serverBusy
- serverMoved
- serverShuttingDown
- serverUnavailable
- sessionTakenOver
- sharedSubscriptionsNotSupported
- subscriptionIdentifiersNotSupported
- success
- topicAliasInvalid
- topicFilterInvalid
- topicNameInvalid
- unspecifiedError
- unsupportedProtocolVersion
- useAnotherServer
- wildcardSubscriptionsNotSupported
RetainHandling 0 = Send retained messages at the time of the subscribe 1 = Send retained messages at subscribe only if the subscription does not currently exist 2 = Do not send retained messages at the time of the subscribe
Return codes on to describe result of subscribe operation
SubackPacket is sent by the server to the client to confirm receipt and processing of a SubscribePacket.
SubscribePacket is sent from client to server to subscribe to topics
Type to limit authentication result to valid values
The MQTT topic to publish to
The MQTT topic to subscribe/unsubscribe to
Type to limit packet type to valid values
Type to limit reason code to valid values
helper type to limit retain handling values
UnsubackPacket is sent by the server to the client to confirm receipt of an UnsubscribePacket.
UnsubscribePacket is sent from client to server to unsubscribe from topics
UTF8 string pair (for v5)
Handler function type for processing publish packets
Interface for persistence implementations to store messages and subscriptions
Maximum packet ID value for MQTT messages (0xffff/65535)
Store type for retained messages mapped by topic
server
This module provides an MQTT Server interface see the /bin folder for examples
The Context class is used to maintain state of a MQTT connection It handles:
Handlers are hooks that the server will call and let you influence the servers behaviour. The following handlers can be configured:
The MqttServer class provides a MQTT server with configurable persistence and authentication/authorization handlers.
tcpClient
This a Deno specific implementation of TCP client sockets it extends the platform agnostic Client class
tcpServer
This module provides a Deno specific implementation of a TCP socket listener it uses the platform agnostic MqttServer class
Trie class for storing and matching hierarchical key-value pairs with wildcard support
utils
This module provides various utilities
assert(expr, msg) throws AssertionError if expr is falsy.
An Async Queue is a queue that can be used to push items to it and then wait for them to be consumed.
logger provides a singleton logger instance