nik-zp / Vue-Mqtt

Connect to mqtt through websocket, implementation for Vuejs 2
95 stars 33 forks source link

Browser starts lagging when I connect to my mosquitto broker #9

Open denisvitez opened 5 years ago

denisvitez commented 5 years ago

When I connect to my Mosquitto broker, the whole chrome process starts to lag like crazy, and will push my i7 over 80%. If I insert an invalid broker address, it will just show an error in console and the browser will work normally. The same happens in Firefox.

I was able to reproduce with the example project and in my own project when I call this line of code. If I comment it out or insert an invalid IP or port, the browser won't lag: Vue.use(VueMqtt, 'ws://192.168.1.33:9001', {clientId: 'WebClient-' + parseInt(Math.random() * 100000)})

mchobbylong commented 5 years ago

Maybe you should try using the original MQTT.js plugin, see if it still makes the browser lag :-) If that does not happen, then it may be something wrong in this plugin.