【发布时间】:2017-01-30 16:55:04
【问题描述】:
我已经设置了一个 mosquitto 代理,但它拒绝通过 websockets 连接 这是我的 conf 文件:
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
listener 1883 0.0.0.0
listener 8008 0.0.0.0
protocol websockets
我在 conf.d 没有任何 conf
使用 PAHO javascript 客户端我得到一个 ERR_CONNECTION_REFUSED
顺便说一句,我使用 debian jessie 作为操作系统
--------------------------编辑 1-------- --------------------------
我已经降低了 iptables,但它仍然无法正常工作。 通常的连接方式是有效的(使用端口 1883) 这是我启动 mosquitto 时的输出
1477788244: mosquitto version 1.4.10 (build date Thu, 25 Aug 2016 10:12:09 +0100) starting
1477788244: Using default config.
1477788244: Opening ipv4 listen socket on port 1883.
1477788244: Opening ipv6 listen socket on port 1883.
【问题讨论】:
-
您是尝试从与代理相同的机器还是从不同的机器连接?您还启用了防火墙吗?
-
测试机器与broker不同,因为正常方式(不是websocket)工作,我会检查iptables看它是否阻塞
-
我已经降低了 iptables 仍然无法正常工作