Skip to content


server - get versionNum/username/password from client object #22

franklovecchio opened this Issue · 0 comments

1 participant


I see that can be grabbed from a connection, but I can't seem to get the versionNum/username/password from the client object (so I can verify auth with a db). I know that the client works with broker using user/pass and versionNum: 3.1.

    clients = { }

    server = mqtt.createServer (client) =>
      console.log 'Broker:mqtt:createServer'

      # Catch when client connects
      client.on 'connect', (packet) =>
        console.log 'Broker:connect'

          returnCode: 0 = packet.client

        console.log 'version: ' + client.versionNum
        console.log 'client: ' + # COMES THROUGH FINE!
        console.log 'username: ' + client.username # undefined
        console.log 'password: ' + client.password # udefined

        clients[] = client

        console.log 'clients: ' + JSON.stringify clients


    server.listen 1883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.