<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.min.js" type="text/javascript"></script>
<script>
// Create a client instance
client = new Paho.MQTT.Client("broker.hivemq.com", 8000, "" , "gokden");
// connect the client
client.connect({onSuccess:onConnect,useSSL:true});
function onConnect(){
console.log("Connected!");
}
</script>
This is my connection code but after 20-25 sec i saw this error: WebSocket connection to ‘wss://broker.hivemq.com:8000/’ failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED
Then after 20-25 sec i saw that error again.