Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var test = require('tape').test
, mqtt = require('mqtt-connection')
, parseStream = mqtt.parseStream
, generateStream = mqtt.generateStream
, through = require('through2')
, reduplexer = require('reduplexer')
, aedes = require('../')
, clients = 0
function setup(broker) {
var inStream = generateStream()
, outStream = parseStream()
, conn = reduplexer(outStream, inStream)
broker = broker || aedes()
broker.handle(conn)
conn.destroy = function() {
inStream.destroy()
'use strict'
var mqtt = require('mqtt-connection')
var through = require('through2')
var aedes = require('../')
var duplexify = require('duplexify')
var parseStream = mqtt.parseStream
var generateStream = mqtt.generateStream
var clients = 0
function setup (broker, autoClose) {
var inStream = generateStream()
var outStream = parseStream()
var conn = duplexify(outStream, inStream)
broker = broker || aedes()
broker.handle(conn)
if (autoClose === undefined || autoClose) {
setTimeout(function () {
broker.close()
}, autoClose || 200)
}