Websocket Client to wss
toJuanito opened this issue · 1 comments
toJuanito commented
Hi, is it possible to communicate through wss protocol?
It works fine for me with ws.
#include <ArduinoJson.h>
#include <HttpClient.h>
#include <SoftwareSerial.h>
#include <Ethernet.h>
#include <WebSocketClient.h>
EthernetClient ethernet;
#include <ArduinoHttpClient.h>
byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};
char serverAddress[] = "wss://192.168.1.87"; //I dont know if it is possible, seems like not..
int port = 8010;
WebSocketClient client = WebSocketClient(ethernet, serverAddress, port);
Thanks in advance..
clysss commented
Perhaps I've not correctly understood the question...
with this following code, I connect with mqttServer="xxx.azurewebsites.net" on port 443... (wss)
WiFiClientSecure wifiClient;
WebSocketClient wsClient(wifiClient, mqttServer, 443);
WebSocketStreamClient wsStreamClient(wsClient, mqttPath);
PubSubClient MQTTClient(wsStreamClient);you should have a look to
https://github.com/clysss/WebSocketStreamClient
and
#124