diff --git a/Tests/MQTTnet.TestApp.AspNetCore2/wwwroot/app/app.ts b/Tests/MQTTnet.TestApp.AspNetCore2/wwwroot/app/app.ts index 0a801c4..166a75a 100644 --- a/Tests/MQTTnet.TestApp.AspNetCore2/wwwroot/app/app.ts +++ b/Tests/MQTTnet.TestApp.AspNetCore2/wwwroot/app/app.ts @@ -13,4 +13,8 @@ client.on('connect', () => { client.on('message', (topic, message) => { // message is Buffer console.log(message.toString()); -}) \ No newline at end of file +}); + +window.onbeforeunload = () => { + client.end(); +}; \ No newline at end of file