mirror of
https://github.com/tsightler/ring-mqtt.git
synced 2025-09-26 21:01:12 +08:00
Migrate aedes MQTT server to ESM
This commit is contained in:
@@ -3,7 +3,7 @@ import chalk from 'chalk'
|
||||
import utils from './utils.js'
|
||||
import fs from 'fs'
|
||||
import parseArgs from 'minimist'
|
||||
import aedes from 'aedes'
|
||||
import Aedes from 'aedes'
|
||||
import net from 'net'
|
||||
import debugModule from 'debug'
|
||||
const debug = debugModule('ring-mqtt')
|
||||
@@ -15,9 +15,9 @@ export default new class Mqtt {
|
||||
this.connected = false
|
||||
|
||||
// Start internal broker, used only for inter-process communication (IPC)
|
||||
const aedesServer = new aedes()
|
||||
const mqttServer = net.createServer(aedesServer.handle)
|
||||
mqttServer.listen(51883, '127.0.0.1')
|
||||
const mqttServer = new Aedes()
|
||||
const netServer = net.createServer(mqttServer.handle)
|
||||
netServer.listen(51883, '127.0.0.1')
|
||||
|
||||
// Configure event listeners
|
||||
utils.event.on('ring_api_state', async (state) => {
|
||||
|
Reference in New Issue
Block a user