Imroy / pubsubclient

A client library for the ESP8266 that provides support for MQTT
MIT License
435 stars 115 forks source link

How to connect to an mqtt broker using hostname instead using the ip address? #57

Open riskico21 opened 8 years ago

g-goessel commented 8 years ago

It's simple, do

WiFiClient espClient;
PubSubClient client(espClient, "server adress");
g-goessel commented 8 years ago

Did it work for you? If so you can close the issue

riskico21 commented 8 years ago

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