教你在windows下搭建MQTT服务器的方法
一、下载mosquitto
点击下载安装程序 下载地址

二、配置mosquitto
1. 安装路径打开命令行界面

2. 设置user及password
执行:mosquitto_passwd.exe -c pwfile.example -u vic
设置用户名:vic 设置密码:123456

3. 配置文件检查
mosquitto.exe -c mosquitto.conf
未报错说明配置正常
4. 设置端口
默认端口:1883
启动:mosquitto.exe
指定端口启动:mosquitto.exe -p 10086
5. 订阅者
mosquitto_sub.exe -h 127.0.0.1 -p 10086 -t topicTest01 -u vic -P 123456
6. 发布者
mosquitto_pub.exe -h 127.0.0.1 -p 10086 -u admin -P 111 -t topicTest01 -m "hello world"
7. 命令行测试

三、MQTTX
1. 连接服务器

2. 订阅topic

3. 发布消息

到此这篇关于windows搭建MQTT服务器的文章就介绍到这了,更多相关MQTT服务器搭建内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
windos server2022的配置故障转移服务的图文教程
本文主要介绍了windos server2022的配置故障转移服务的图文教程,以确保服务和应用程序的连续性和可用性,文中通过图文介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2025-01-01
访问网站提示An error occurred on the server when processing the UR
这篇文章主要介绍了An error occurred on the server when processing the URL. Please contact the system administrator提示的解决方法2015-08-08
windows server 2012 r2 服务器部署tp6 项目
这篇文章主要介绍了windows server 2012 r2 服务器部署tp6 项目,需要的朋友可以参考下2022-03-03


最新评论