diff --git a/Source/MQTTnet.Server/Program.cs b/Source/MQTTnet.Server/Program.cs index 9161f166..9cc77e88 100644 --- a/Source/MQTTnet.Server/Program.cs +++ b/Source/MQTTnet.Server/Program.cs @@ -50,7 +50,7 @@ namespace MQTTnet.Server Console.ForegroundColor = ConsoleColor.White; Console.WriteLine(@" - Version: 1.0.0-alpha1 + Version: 1.0.0-alpha2 License: MIT (read LICENSE file) Sponsoring: https://opencollective.com/mqttnet Support: https://github.com/chkr1011/MQTTnet/issues diff --git a/Source/MQTTnet.Server/wwwroot/Index.html b/Source/MQTTnet.Server/wwwroot/Index.html deleted file mode 100644 index 5ee25faf..00000000 --- a/Source/MQTTnet.Server/wwwroot/Index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - MQTTnet Server test - - - - - -
-

- - - -
- -
- -
- - - \ No newline at end of file diff --git a/Source/MQTTnet.Server/wwwroot/app/app.ts b/Source/MQTTnet.Server/wwwroot/app/app.ts deleted file mode 100644 index b7167701..00000000 --- a/Source/MQTTnet.Server/wwwroot/app/app.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { connect } from "mqtt"; - -var client = connect('ws://' + location.host + '/mqtt', - { - clientId: "client" + Math.floor(Math.random() * 6) + 1 - }); - -window.onbeforeunload = () => { - client.end(); -}; - -var publishButton = document.getElementById("publish"); -var topicInput = document.getElementById("topic"); -var msgInput = document.getElementById("msg"); -var stateParagraph = document.getElementById("state"); -var msgsList = document.getElementById("msgs"); - -publishButton.onclick = click => { - var topic = topicInput.value; - var msg = msgInput.value; - client.publish(topic, msg); -}; - -client.on('connect', () => { - client.subscribe('#', { qos: 0 }, (err, granted) => { - console.log(err); - }); - client.publish('presence', 'Hello mqtt'); - - stateParagraph.innerText = "connected"; - showMsg("[connect]"); -}); - -client.on("error", e => { - showMsg("error: " + e.message); -}); - -client.on("reconnect", () => { - stateParagraph.innerText = "reconnecting"; - showMsg("[reconnect]"); -}); - -client.on('message', (topic, message) => { - showMsg(topic + ": " + message.toString()); -}); - -function showMsg(msg: string) { - //console.log(msg); - - var node = document.createElement("LI"); - node.appendChild(document.createTextNode(msg)); - - msgsList.appendChild(node); - - if (msgsList.childElementCount > 50) { - msgsList.removeChild(msgsList.childNodes[0]); - } -} \ No newline at end of file