I have tried to establish a MQTT connection from the browser by using Kii Cloud service, but it failed.
Would you please any advise ?
[Event]
I have tried to establish a connection by using the end-point which I got from the Kii Cloud MQTT, but returned the following error.
※I use paho for MQTT client.
WebSocket connection to 'ws://[hostname which I got from Kil Cloud]:[port which I got from Kil Cloud]/mqtt' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
[What I tried]
·I isolate the cause of the problem. (client--side or server--side)
→I run the sample code of paho, it was able to successfully connect to the broker(test.mosquitto.org:8080).
· Ping communication confirmation
→I can not ping the host I got from Kii Cloud.(I can ping the broker above)
[My code]
// Create a client instance
client = new Paho.MQTT.Client([hostname which I got from Kil Cloud], [port which I got from Kil Cloud], "clientId");
// set callback handlers
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
// connect the client
// client.connect({onSuccess:onConnect});
client.connect({
onSuccess:onConnect,
userName:[username which I got from Kil Cloud],
password:[password which I got from Kil Cloud]
});
[Environment]
Google Chrome: ver 49.0.2623.112 m
Client-side: paho
Server side: Kii Cloud
Thank you very much.