Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mqtt-packet

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mqtt-packet - npm Package Compare versions

Comparing version 6.8.1 to 6.9.0

2

constants.js

@@ -174,2 +174,4 @@ /* Protocol - protocol constants */

protocol.VERSION5 = Buffer.from([5])
protocol.VERSION131 = Buffer.from([131])
protocol.VERSION132 = Buffer.from([132])

@@ -176,0 +178,0 @@ /* QoS */

2

package.json
{
"name": "mqtt-packet",
"version": "6.8.1",
"version": "6.9.0",
"description": "Parse and generate MQTT packets like a breeze",

@@ -5,0 +5,0 @@ "main": "mqtt.js",

@@ -161,2 +161,7 @@ const bl = require('bl')

if (packet.protocolVersion >= 128) {
packet.bridgeMode = true
packet.protocolVersion = packet.protocolVersion - 128
}
if (packet.protocolVersion !== 3 && packet.protocolVersion !== 4 && packet.protocolVersion !== 5) {

@@ -341,2 +346,6 @@ return this._emitError(new Error('Invalid protocol version'))

subscription.rh = rh
} else if (this.settings.bridgeMode) {
subscription.rh = 0
subscription.rap = true
subscription.nl = true
}

@@ -343,0 +352,0 @@

@@ -86,3 +86,3 @@ const protocol = require('./constants')

const protocolId = settings.protocolId || 'MQTT'
const protocolVersion = settings.protocolVersion || 4
let protocolVersion = settings.protocolVersion || 4
const will = settings.will

@@ -221,8 +221,17 @@ let clean = settings.clean

writeStringOrBuffer(stream, protocolId)
if (settings.bridgeMode) {
protocolVersion += 128
}
stream.write(
protocolVersion === 4
? protocol.VERSION4
: protocolVersion === 5
? protocol.VERSION5
: protocol.VERSION3
protocolVersion === 131
? protocol.VERSION131
: protocolVersion === 132
? protocol.VERSION132
: protocolVersion === 4
? protocol.VERSION4
: protocolVersion === 5
? protocol.VERSION5
: protocol.VERSION3
)

@@ -229,0 +238,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc