title: nodejs mqttjs Missing protocol error
body: <p>I'm attempting to get a working example of mqttjs in nodejs. I'm receiving this error while attempting to execute my main.js file using command <code>node main.js</code> in Windows 10 cmd prompt:</p>
  
  <p>error:</p>
  
  <pre><code>C:\Users\Rich\Documents\Code\nodejs\onoff\node_modules\mqtt\lib\connect\index.js:64
        throw new Error('Missing protocol')
        ^
  
  Error: Missing protocol
      at Object.connect (C:\Users\Rich\Documents\Code\nodejs\onoff\node_modules\mqtt\lib\connect\index.js:64:13)
      at Object.&lt;anonymous&gt; (C:\Users\Rich\Documents\Code\nodejs\onoff\main.js:2:20)
      at Module._compile (module.js:652:30)
      at Object.Module._extensions..js (module.js:663:10)
      at Module.load (module.js:565:32)
      at tryModuleLoad (module.js:505:12)
      at Function.Module._load (module.js:497:3)
      at Function.Module.runMain (module.js:693:10)
      at startup (bootstrap_node.js:188:16)
      at bootstrap_node.js:609:3
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>var mqtt = require('mqtt');
  var client  = mqtt.connect('192.168.0.22');
  
  client.on('connect', function () {
    client.subscribe('mydevice')
    client.publish('presence', 'Hello mqtt')
  })
  
  client.on('message', function (topic, message) {
    // message is Buffer
    console.log(message.toString())
    client.end()
  })
  </code></pre>