eclipse-paho / eclipse-paho/paho.mqtt.javascript
Problem with Websocket MQTT
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 466
- PR merge metrics
- No merged PRs in 30d
Description
**Hello
Here is my code that generates the following error message in my browser console. Thanks very much to help me !**
The code :
MQTT
-->
Connexion MQTT :
// Create a client instance
client = new Paho.MQTT.Client("b37.mqtt.one", 8083,"client_id");
// set callback handlers
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
var options = {
//timeout: 3,
useSSL: true,
userName: "260fqs693",
password: "469efgijsu",
onSuccess:onConnect,
onFailure:doFail
}
// connect the client
client.connect(options);
// called when the client connects
function onConnect() {
// Once a connection has been made, make a subscription and send a message.
console.log("onConnect");
client.subscribe("260fqs693/Entrant");
message = new Paho.MQTT.Message("Hello");
message.destinationName = "260fqs693/Sortant";
client.send(message);
}
function doFail(e){
console.log(e);
}
// 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);
}
The message on console :

Contributor guide
Assessment
This issue has not been assessed yet.