Mosquitto经纪人1.5.9版
已启用并建立了WebSocket支持
在代理上打开端口9001
OS Amazon Linux 2 AMI(Fedora)
mosquitto_conf
port 1883
listener 9001
protocol websockets
==========================================================
1592388049: mosquitto -c /etc/mosquitto/mosquitto.conf
1592388049: mosquitto version 1.5.9 starting
1592388049: Config loaded from /etc/mosquitto/mosquitto.conf.
1592388049: |-- *** auth-plug: startup
1592388049: |-- ** Configured order: mysql
1592388049: |-- }}}} MYSQL
1592388049: |-- SSL is disabled
1592388049: Opening websockets listen socket on port 9001.
1592388049: Opening ipv4 listen socket on port 1883.
1592388049: Opening ipv6 listen socket on port 1883.
但是,当我尝试使用简单的Paho Javascript程序通过websocket连接到代理时,出现以下错误:
mqttws31.js:977 WebSocket连接到'ws://x.x.x.x:9001 / mqtt' 失败:建立连接错误:net :: ERR_CONNECTION_REFUSED
连接失败:AMQJSC0001E连接超时。重试