How to control ESP32 dev board with the Node-RED built-in broker Aedes?

The Aedes repo example has this:

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

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

I had previously used this (partial) code for the ESP8266 dev board, some online broker, AWS and Node-RED:

#include <ESP8266WiFi.h>
#include <PubSubClient.h>

// [...]

void loop() {
  client.publish("voltage", msg);

Should the PubSubClient library be used? I mean, is it needed? Or is there a way to do it with just WiFiClientSecure or the WiFi library?

One Arduino client for MQTT is needed:
• PubSubClient
• MQTTClient

Publisher ↔ Broker ↔ Subscriber

For example:

Node-RED ↔ Aedes ↔ PubSubClient

Detailed explanation: