Goran58 / node-spc-mqtt

MIT License
1 stars 2 forks source link

Feature request MQTT with user and password #2

Open Jibbonator opened 1 year ago

Jibbonator commented 1 year ago

Is it possible to use this with my mqtt broker, that uses a username and a password?

Jibbonator commented 1 year ago

Nevermind I´ve added

"mqtt_user": "User",
"mqtt_password": "Password"

to config.json

and

     protocolVersion: 3,     // ""
     username: config.mqtt_user,     
     password: config.mqtt_password

to node-spc-mqtt.js

and it worked.

maybe you could integrate it, with and witohut password.

davkav commented 1 year ago

I have had the gateway and mqtt add-on in place for a while now. Tonight I decided to do a security review on all of my apps and services, and configured username and password on MQTT. Your timing for this post could not have been better. Thanks for coming back and posting your solution!