2016-03-10 150 views
1

我有這個mosquitto.config錯誤:淨:: ERR_CONNECTION_RESET

listener 1885 
allow_anonymous false 
listener 9001 127.0.0.1 
protocol websockets 
user manish 
auth_opt_backends postgres 
auth_plugin /etc/mosquitto/auth-plug.so 
auth_opt_dbname mqtt 
#auth_opt_host localhost 
#auth_opt_port 5432 
auth_opt_user postgres 
auth_opt_pass 123 
auth_opt_userquery SELECT password FROM account WHERE username = $1 limit 1 
auth_opt_superquery SELECT COALESCE(COUNT(*),0) FROM account WHERE username = $1 AND super = 1 
auth_opt_aclquery SELECT topic FROM acls WHERE (username = $1) AND (rw >= $2) 

當我做網頁套接字連接我正在

Host=127.0.0.1, port=1885, path=/mqtt TLS = false username=u1 password=
paho.js:2067 Uncaught AMQJS0013E Invalid argument [object Object] for newPayload.Paho.MQTT.Message @ paho.js:2067MQTTconnect @ index.html:45(anonymous function) @ index.html:79m.Callbacks.j @ jquery-1.11.3.min.js:2m.Callbacks.k.fireWith @ jquery-1.11.3.min.js:2m.extend.ready @ jquery-1.11.3.min.js:2J @ jquery-1.11.3.min.js:2 
paho.js:979 WebSocket connection to 'ws://127.0.0.1:1885/mqtt' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET 
paho.js:977 WebSocket connection to 'ws://127.0.0.1:1885/mqtt' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET 

回答

2

你使用了錯誤的端口號

在瀏覽器中收到此錯誤

您已在9001上配置了Websockets,但您嘗試連接到端口1885

相關問題