added aspnetcore package and adapted sample app

This commit is contained in:
Jan Eggers
2017-10-24 12:45:14 +02:00
parent 3529724bdc
commit 1ca9b0bd62
15 changed files with 260 additions and 41 deletions
@@ -0,0 +1,16 @@
import { connect } from "mqtt";
var client = connect('ws://' + location.host + '/mqtt',
{
clientId: "client1",
});
client.on('connect', () => {
client.subscribe('presence');
client.publish('presence', 'Hello mqtt');
});
client.on('message', (topic, message) => {
// message is Buffer
console.log(message.toString());
})