Closed markevans-sky closed 5 years ago
Hi there - I'm using Paho to connect to MQTT via websocket in an environment which is a modified version of Node.js.
It was causing an error "ReferenceError: WebSocket is not defined" due to the line https://github.com/eclipse/paho.mqtt.javascript/blob/develop/src/paho-mqtt.js#L1054, which contains
new WebSocket(...)
Changing this to
new global.WebSocket(...)
fixes the problem.
Hi there - I'm using Paho to connect to MQTT via websocket in an environment which is a modified version of Node.js.
It was causing an error "ReferenceError: WebSocket is not defined" due to the line https://github.com/eclipse/paho.mqtt.javascript/blob/develop/src/paho-mqtt.js#L1054, which contains
Changing this to
fixes the problem.