mqttjs / mqtt-server

Simple API to build your own MQTT server on top of it.
Other
104 stars 31 forks source link

Example code not complete #5

Open basickarl opened 4 years ago

basickarl commented 4 years ago
servers.listen(function(){
^

ReferenceError: servers is not defined
    at Object.<anonymous> (/home/karl/dev/javascript/sandbox.js:16:1)

Example code is not complete!

esbenvb commented 3 years ago

The start of the code should be something like

const mqttServer = require('mqtt-server');

const servers = mqttServer({
// .....

That will at least run - but I cant, make it forward any messages though...