2024-06-12 06:58:45 +09:00
2024-06-12 06:58:45 +09:00
2024-06-12 06:58:45 +09:00

npm install aedes --save npm install aedes-cli --global

const aedes = require('aedes')();
const server = require('net').createServer(aedes.handle);
const port = 1883;

server.listen(port, function () {
  console.log('Aedes broker started and listening on port ', port);
});

aedes.on('client', function (client) {
  console.log('Client Connected:', client.id);
});

aedes.on('clientDisconnect', function (client) {
  console.log('Client Disconnected:', client.id);
});

aedes.on('publish', function (packet, client) {
  console.log('Published:', packet.payload.toString());
});
Description
MQTTサーバーをNPM(aedes)で作成しています。 Mockとして開発しております
Readme 63 KiB
Languages
JavaScript 93.1%
Dockerfile 6.9%