I'm writing a simple MQTT Server using aedes and Nodejs.
Here is my broker code:
import aedes from "aedes";
import net from "net";
const port = 1883; // MQTT Port
const broker = net.createServer(aedes.handle);
broker.listen(port, () => {
console.log(`Find the server at: mqtt://localhost:${port}/`);
});
As the client I'm using MQTT X for MacOS Ventura 13.2:
I cannot connect to the server. The client times out without connecting. I've tried changing localhost to 127.0.0.1 with no success...
If I try telnet I can see the port is open:
$ telnet localhost 1883
Trying ::1...
Connected to localhost.
Escape character is '^]'.
sdfsdf
^C
What may be causing my client not to connect to the broker? How to make it connect?