pubsubclient
pubsubclient copied to clipboard
How to connect to an mqtt broker using hostname instead using the ip address?
It's simple, do
WiFiClient espClient;
PubSubClient client(espClient, "server adress");
Did it work for you? If so you can close the issue
i'm so sorry for the late reply, i already tested your solution and i think it might be work. But in my case i want to use "ngrok" to tunnel my mqtt broker connection so that i can publish a message from anywhere over the internet. the string address called "tcp.ngrok.io" and i also already changed the port number on the PubSubClient.h but nothing happened