Hi @knolleary
I have a MQTT broker running over websockets using SSL on my server.
Would like my ESP2866 client to connect to this broker.
Will you please help me in sample code to implement it.
Thanks.
Hi. This library doesn't support websockets. Sorry.
Hi @knolleary
Thanks for your quick reply.
So is there any workaround to implement secured MQTT client?
Any other alternative ?
Thanks.
You may have a look into (if speaking of ESP chip based implementation).
https://github.com/me-no-dev/ESPAsyncTCP
https://github.com/marvinroger/async-mqtt-client
Good luck ;)
@romuye123 I found some libraries
https://github.com/tuanpmt/ESP8266MQTTClient
https://github.com/areve/WebSocketStreamClient
FOR ESP8266 :
I'm using areve https://github.com/areve/WebSocketStreamClient :+1:
2 lignes of code and you're using PubSubClient over WS (WSS SUPPORTED)
without any modification on PubSubClient lib itself
:))))
example code :
WiFiClientSecure wiFiClient;
WebSocketClient wsClient(wiFiClient, host, port);
WebSocketStreamClient wsStreamClient(wsClient, path);
PubSubClient mqtt(wsStreamClient);
....
mqtt.setCallback(onMqttPublish);
mqtt.connect("xxxxx")
You can also have a look to my own repo for version compatible with last Arduino version
@knolleary : perhaps the idea of implementing ws through client.h with arduinohttpclient (or other) could be an "official" way to support ws...
Most helpful comment
You may have a look into (if speaking of ESP chip based implementation).
https://github.com/me-no-dev/ESPAsyncTCP
https://github.com/marvinroger/async-mqtt-client
Good luck ;)