linux – mosquitto-client获得拒绝连接

我想使用mosquitto库使用MQTT协议.

首先,我想做一些安装mosquitto-clients的测试

 sudo apt-get install mosquitto-clients

该程序提供了两种“方法”:

> mosquitto_pub
> mosquitto_sub

按照this说明我正在尝试提交新主题

mosquitto_sub -d -t newtopic/test

使用认主机/端口[localhost / 1883].

我获得:

Error: Connection refused

过于通用,因为错误..任何人都可以帮助我吗?
可能是防火墙问题?在这种情况下,我该如何检查这是否是问题?

我正在使用linux ubuntu(3.8.0-42-generic#62~minision1-Ubuntu)

使用libmosquitto编写自定义程序的相同行为.

最佳答案
mosquitto_pub / sub的认主机:端口组合是localhost:1883.如果您没有在本地计算机上运行代理,那么当然它将无法连接.

解决方案是在本地计算机上运行代理,或者告诉实用程序在哪里连接.例如:

mosquitto_sub -t newtopic/test -h test.mosquitto.org

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...