Skip to content

Commit 3b57603

Browse files
upload project
0 parents  commit 3b57603

File tree

6 files changed

+4102
-0
lines changed

6 files changed

+4102
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

broker.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const mosca = require('mosca')
2+
3+
const broker = new mosca.Server({
4+
port: 9000
5+
})
6+
7+
broker.on('ready', () => {
8+
console.log('Mosca broker is ready!')
9+
})
10+
11+
broker.on('clientConnected', (client) => {
12+
console.log('New client' + client.id)
13+
})
14+
15+
// broker.on('published', (packet) => {
16+
// console.log(packet.payload.toString())
17+
// })

0 commit comments

Comments
 (0)