You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have installed HiveMQ and running on my machine, from javascript client am trying to connect, but getiing floowing error WebSocket connection to 'ws://192.168.1.100:8000/mqtt' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED in chrome , below is the code am using
// Create a client instance
client = new Paho.MQTT.Client("192.168.1.100", 8000, "100");
//var s = new ReconnectingWebSocket("ws://192.168.1.100:1883");
// set callback handlers
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
// connect the client
client.connect({onSuccess:onConnect});
// called when the client connects
function onConnect() {
alert("connected");
// Once a connection has been made, make a subscription and send a message.
console.log("onConnect");
client.subscribe("/World");
message = new Paho.MQTT.Message("Hello");
message.destinationName = "/World";
client.send(message);
}
// called when the client loses its connection
function onConnectionLost(responseObject) {
if (responseObject.errorCode !== 0) {
console.log("onConnectionLost:"+responseObject.errorMessage);
}
}
// called when a message arrives
function onMessageArrived(message) {
console.log("onMessageArrived:"+message.payloadString);
}
</script>
plz help me out
The text was updated successfully, but these errors were encountered:
I have installed HiveMQ and running on my machine, from javascript client am trying to connect, but getiing floowing error WebSocket connection to 'ws://192.168.1.100:8000/mqtt' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED in chrome , below is the code am using
<script src="../bower_components/jquery/dist/jquery.min.js"></script> <script src="../js/mqttws31.js"></script> <script src="../js/mqttws31-min.js"></script> <script src="../js/reconnecting-websocket.js"></script> <script src="../js/reconnecting-websocket.min.js"></script> <script>The text was updated successfully, but these errors were encountered: