|
@@ -13,4 +13,8 @@ client.on('connect', () => { |
|
|
client.on('message', (topic, message) => { |
|
|
client.on('message', (topic, message) => { |
|
|
// message is Buffer |
|
|
// message is Buffer |
|
|
console.log(message.toString()); |
|
|
console.log(message.toString()); |
|
|
}) |
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
window.onbeforeunload = () => { |
|
|
|
|
|
client.end(); |
|
|
|
|
|
}; |