使用身份验证用户名密码的Mosquitto MQTT Broker设置

时间:2015-12-17 15:43:51

标签: mqtt mosquitto

我正在尝试使用带有用户名和密码的身份验证在Windows上配置Mosquitto MQTT代理。

我在mosquitto.conf文件中添加了以下行:

allow_anonymous false

用户名测试 remote_username测试

remote_password Test123

发生运行代理跟踪错误时:

  

C:\ Program Files(x86)\ mosquitto> mosquitto.exe -c mosquitto.conf -p   1883错误:桥配置无效。发现错误   mosquitto.conf:750。错误:无法打开配置文件。

没有用户名和密码,我可以启动代理并与MQTTLens客户端连接。

谢谢, 阿肖克

1 个答案:

答案 0 :(得分:4)

var formData = { filename: filename, file: fs.createReadStream(fileloc) } var req = request.post({url: 'http://myvendorsapi/Upload_PDF', formData: formData}) req.pipe(fs.createWriteStream('OUTPUT FILE NAME')) remote_username选项用于配置网桥。您应该查看remote_password选项。例如

password_file

使用

生成文件
password_file /etc/mosquitto/pwfile

并添加更多用户

mosquitto_passwd -c /etc/mosquitto/pwfile ashok